The apt command is used for package management in Debian and Ubuntu. While you are probably already familiar with the install and remove options, apt provides a few extra features as well.
One of them is the ability to see all the upgradable packages on your system. And to display them, all you have to do is to use this command in the terminal:
apt list --upgradable
As you can notice, you don’t even need sudo to list the updatable packages. It just lists the packages that can be updated. It doesn’t update them.
In fact, the apt command adds this hint when you run the
sudo apt update command to update the local package repository cache.
Fetched 1,243 kB in 17s (71.4 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 30 packages can be upgraded. Run 'apt list --upgradable' to see them.
I don’t recall any similar direct option in the older apt-get command to list all the upgradable packages. That’s one of the several new features apt has added on top of the older apt-get command.
Let’s talk about it in a bit more detail.
Listing all the upgradable packages
What you should know here is that you only get to list the updates available through the APT package manager. So, if you have added PPAs or external repositories to your system’s sources.list, you’ll see the updates from them.
But you won’t get updates for AppImage, Flatpak, Snap or some other packaging formats here.
In other words, it works with apt packages only.
So, to list all the upgradable packages on your Ubuntu or Debian system, you should update the local package cache first:
sudo apt update
And then your system will be aware of the available package updates. The apt command tells you how many packages can be upgraded at the end of the update command: