How to quickly update all software on Ubuntu with just one command

  • Published
  • Posted in Tech News
  • 3 mins read

The Ubuntu logo with people jumping in the air

One of the reasons many people use Linux instead of Windows is the simplicity of installing software updates. Not only are they simple, but they’re also very fast, a clean install of Ubuntu, for example, can be brought up-to-date within 20 minutes or so.

You can also see exactly what’s going on during the update, there are no ambiguous messages that make it look like something has crashed. Despite these perks, the additional package formats such as Snap, are complicating things a little bit.

Canonical has set up Ubuntu so that security updates are downloaded and installed in the background. Unfortunately, “other updates” such as browser upgrades are only mentioned to users once a week but they don’t install automatically, the user has to do it.

On top of the “other software” problem, you also have Snaps. Until a few months ago it seemed like these were updating on their own, but recently I’ve been getting notifications saying that updates are ready to be applied; this means more work for me!

Some of you may be aware of the apt update and apt upgrade commands, these are great for updating your Deb packages but they don’t touch the Snap packages, for these, you need to use snap refresh. If you use these commands, you’re interrupted mid-way to ask if you definitely want to apply the updates.

Considering that most updates are pretty stable, it’s good to be able to install all Deb and Snap packages in one fell swoop, without being asked to confirm the updates and without having to do separate commands for Debs and Snaps.

The command to update everything in one go is:

sudo apt update && sudo apt upgrade -y && sudo snap refresh

Once you’ve typed or copied that into your terminal window, you’ll be asked for your password and then it will look for updates and apply them without confirmation, it will also check for new Snaps and apply any available updates.

A terminal window with the update command

If you’d like more control over the update process, feel free to use the command below:

sudo apt update && sudo apt upgrade && sudo snap refresh

The command above omits the “-y” portion, this means you’ll be shown the updates that’ll be installed and you’ll be asked to confirm them to make sure you’re happy. This is helpful if you’re aware of any troublesome packages that you don’t want to install on your system accidentally.

As the update command is one you’ll probably want to run several times over a few weeks it’s handy to know that you can tap the Up arrow whilst in the terminal to flick through previously used commands, you can this to go back to the update command above and tap enter to get the process stated.

Flatpaks are not supported by Ubuntu out of the box, but if you do use them, you could adapt the command from earlier to:

sudo apt update && sudo apt upgrade -y && sudo snap refresh && sudo flatpak update

This command should also apply all the available Flatpak updates too if there are any to be had. These commands should work on any system that uses apt. You can adjust it to omit && sudo snap refresh if you don’t use Snaps, such as if you’re on Linux Mint.

If you know any more helpful commands such as these, let us know in the comments.

News Article Courtesy Of Paul Hill »