I know that I can update a snap package using
sudo snap refresh <package>
But is there a way to update all snaps, like
sudo apt dist-upgrade
I know that I can update a snap package using
sudo snap refresh <package>
But is there a way to update all snaps, like
sudo apt dist-upgrade
Will do this. It is part of
snapd
2.0.8, which landed 2016-06-13 inxenial-updates
.Only lists the updates without refreshing the packages.
Can show which versions are available for a particular package.
You can also update a specific application if the other method fails
Example usage:
According to Snap tutorial Snaps are automatically updated in the background once per day.
However, if you don't close the application it will not be updated and you will receive daily notifications to do so.
Generally, you don't need to do anything.
snapd, in Ubuntu installs, will automatically check for updates. That's a key feature of snaps.
Here's how to determine how often snapd will automatically check for updates: (source)
Try running
snap
withsudo
:Try this in
/usr/bin/update-snaps
:Updates the Snap packages
If what we want is to check if there is an update of an app and install it, the command will be the following, where APPLICATION corresponds to the program we want to update:
For example, if we want update Firefox, the command would be
sudo snap refresh firefox
.What I and maybe some of you are wondering is: "Who updates only one package from the terminal?" Surely someone will, but I usually update everything. The Snap equivalent of
sudo apt update && sudo apt upgrade
, Is the following:By not indicating any package, what it will do is search for all the Snaps that we have installed, it will check if there is a new version and it will install it.
List updates without installing them
The third command I was talking about may be interesting if you only want to install some packages. It would be the following:
This can help us, for example, if we are waiting for an update like May water, we see that it is and then we want to install the app we expected and some other, avoiding installing everything if it turns out that there is a lot to install. In this way, we would save time. In this article you have other options that we can use with the «snap» command.
An alternative way that worked for me was to go to the search bar and search for snap store, open that up, go to the update tab, then press update.
With Slack (and some other apps) it's a little more tricky because they run in the background and start automatically on reboot. Be sure to close the app in the background and ensure that it has not started automatically on reboot if you wish to update. Here's a command to stop slack as an example of such a program:
sudo kill -9 $(pidof slack)
After that you can run the update of the specific app:
sudo snap refresh slack --classic
to have it take effect.
Here's a handy copy and paste one-liner:
sudo kill -9 $(pidof slack);sudo snap refresh slack --classic
Might even put that in a shutdown script to fully automate.