Check For Available Updates with apt

apt-list-upgradable-ubuntu-19-04

I’ve been updating software on Ubuntu 19.04 install on my Dell XPS laptop and realised that I haven’t shared this basic tip yet: it’s possible to use apt to quickly see available upgrades for installed packages.

List upgradable packages with apt

apt list command will show you all the packages installed in your Ubuntu, but if you specify the –upgradable flag it will just report the packages that have available updates:

root@xps:/ # apt list --upgradable 
Listing... Done 
bind9-host/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
brave-browser/disco 0.64.76 amd64 [upgradable from: 0.64.75] 
debconf-i18n/disco-updates,disco-updates 1.5.71ubuntu1 all [upgradable from: 1.5.71] 
debconf/disco-updates,disco-updates 1.5.71ubuntu1 all [upgradable from: 1.5.71] 
dnsutils/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
fonts-opensymbol/disco-updates,disco-updates 2:102.10+LibO6.2.3-0ubuntu0.19.04.1 all [upgradable from: 2:102.10+LibO6.2.2-0u
buntu2] 
gnome-control-center-data/disco-updates,disco-updates 1:3.32.1-1ubuntu4.1 all [upgradable from: 1:3.32.1-1ubuntu4] 
gnome-control-center-faces/disco-updates,disco-updates 1:3.32.1-1ubuntu4.1 all [upgradable from: 1:3.32.1-1ubuntu4] 
gnome-control-center/disco-updates 1:3.32.1-1ubuntu4.1 amd64 [upgradable from: 1:3.32.1-1ubuntu4] 
gnome-shell-extension-appindicator/disco-updates,disco-updates 29-1~ubuntu19.04.1 all [upgradable from: 28-1] 
libbind9-161/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libdns-export1104/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libdns1104/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libirs161/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libisc-export1100/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libisc1100/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libisccc161/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libisccfg163/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
liblwres161/disco-updates 1:9.11.5.P1+dfsg-1ubuntu2.4 amd64 [upgradable from: 1:9.11.5.P1+dfsg-1ubuntu2.3] 
libreoffice-avmedia-backend-gstreamer/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2] 
libreoffice-base-core/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2] 
libreoffice-calc/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2] 
libreoffice-common/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2] 
libreoffice-core/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2] 
libreoffice-draw/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-gnome/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-gtk3/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-help-en-gb/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-help-en-us/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-impress/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-l10n-en-gb/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-math/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-ogltrans/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-pdfimport/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-style-breeze/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-style-colibre/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-style-elementary/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-style-tango/disco-updates,disco-updates 1:6.2.3-0ubuntu0.19.04.1 all [upgradable from: 1:6.2.2-0ubuntu2]
libreoffice-writer/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
python3-debconf/disco-updates,disco-updates 1.5.71ubuntu1 all [upgradable from: 1.5.71]
python3-uno/disco-updates 1:6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 1:6.2.2-0ubuntu2]
ubuntu-settings/disco-updates,disco-updates 19.04.3.1 all [upgradable from: 19.04.3]
ubuntu-web-launchers/disco-updates,disco-updates 19.04.3.1 all [upgradable from: 19.04.3]
uno-libs3/disco-updates 6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 6.2.2-0ubuntu2]
ure/disco-updates 6.2.3-0ubuntu0.19.04.1 amd64 [upgradable from: 6.2.2-0ubuntu2]
root@xps:/ #

Confirm Number of Available Updates with apt

We can use wc command to count the number of available packages returned by apt list –upgradable. But because the output starts with line “Listing…”, we should probably use grep command to get rid of it:

root@xps:/ # apt list --upgradable | grep -v Listing | wc -l
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
45

We will see the same number of packages if we run apt update (but don’t press Y or Enter if you’re not ready to upgrade packages just yet):

root@xps:/ # apt upgrade
Reading package lists... Done
Building dependency tree 
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libgsasl7 libkyotocabinet16v5 libmailutils5 libntlm0 libpython2.7 libpython2.7-minimal libpython2.7-stdlib
mailutils-common
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
bind9-host brave-browser debconf debconf-i18n dnsutils fonts-opensymbol gnome-control-center gnome-control-center-data
gnome-control-center-faces gnome-shell-extension-appindicator libbind9-161 libdns-export1104 libdns1104 libirs161
libisc-export1100 libisc1100 libisccc161 libisccfg163 liblwres161 libreoffice-avmedia-backend-gstreamer
libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome
libreoffice-gtk3 libreoffice-help-en-gb libreoffice-help-en-us libreoffice-impress libreoffice-l10n-en-gb
libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-colibre
libreoffice-style-elementary libreoffice-style-tango libreoffice-writer python3-debconf python3-uno ubuntu-settings
ubuntu-web-launchers uno-libs3 ure
45 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
Need to get 187 MB of archives.
After this operation, 2,529 kB disk space will be freed.
Do you want to continue? [Y/n]

See Also