Keep your Ubuntu software updated


In many cases you will use an Ubuntu machine, either as a server or Personal Computer. It’s very important you keep your Ubuntu software updated, both for the packages you installed via apt and your snaps or flatpaks. Below you can find a few commands to do this.

Software is everywhere

You have a Ubuntu machine, whether it’s your laptop or server. You installed plenty of packages via apt or using Snap. Or maybe Flatpak. It’s never been so easy to add new pieces of software.

However, the multiplicity of sources for Software installation also means you need to keep your software updated in a variety of ways. And keeping your Software updated is very important for both performance and security purposes. Let’s explore what are the ways to keep your machine performant and secure.

Old good apt

Ubuntu comes with it’s own package manager, apt. Chances are you will install most of your Software this way. In order to keep your apt packages updated, there are just two commands you need to use:

sudo apt update
sudo apt upgrade

The above lines will update all the packages that got a new version. If you only want to update a specific package, instead you should use the following command instead than the second line above:

sudo apt upgrade <packagename>

In some cases you will be prompted to approve with a "Y" key, and then apt will download and install the updates for all packages you installed with it. All done for this part!

And then there were Snaps

Canonical launched an alternative platform to package and distribute software, the Snap one. Ubuntu Software should automatically notify and prompt you to update your Snaps…but in many cases the experience with Ubuntu Software doesn’t live up to expectations.

However, you can always resort to the old good command line to keep your Snaps updated.

snap refresh --list

This command will tell you which Snaps can be updated. You can then decide to update all of them with:

sudo snap refresh 

Or you can select which ones you want to update:

sudo snap refresh <snapname>

A little note on Snap Store updates

If you try to update the Snap Store, you will find that it does not really update…but some annoying pop-up from Ubuntu (like the one below) reminds you that it should.

Keep your Ubuntu Software updated - snap store need update
Ubuntu Snap Store needs your help…

In fact, you cannot update the Snap Store while it’s running. But if you only close the Ubuntu Software app, the Snap Store will continue to run in the background. Therefore, you need to close it manually from the terminal:

snap-store --quit
sudo snap refresh

This will make the trick!

Finally, Flatpaks

As I mentioned above, Ubuntu Software did raise some eyebrows in terms of usability…so alternative platforms for software distribution propped up. One of the most important around there is Flatpak.

If you want to check what pieces of Software you installed using Flatpak, you can type:

flatpak list

This is the output I got:

Keep your Ubuntu Software updated - flatpak list output
flatpak list output

If you want to update a specific application, you need to note its name in the “Application ID” column and then use this command:

sudo flatpak update <ApplicationID>

If instead you want to update all packages you have installed, the command is:

sudo flatpak update

In almost all cases Flatpak will prompt you to confirm operations with a "Y" key.

And that’s it! Hope you found this little guide useful!

  • Update Snaps fro command line link
  • Update Flatpaks from command line link

Do you like our content? Check more of our posts in our blog!