Keeping your Ubuntu system up-to-date is critical to ensuring a system’s stability and security. This is common to all Unix/Linux platforms, not just Ubuntu.
Ubuntu systems should be regularly monitored for new updates to installed packages and updated whenever package updates become available. On the other hand, if the upgrade is unsuitable for the running application, upgrading the packages may break your application functionality. So, before upgrading Ubuntu system, you should check the application dependency.
In this tutorial, we will show you whether package updates are available in Ubuntu or not.
Listing Upgradable Packages in Ubuntu
The apt command is used for package management in Debian and Ubuntu, so first run the apt update command to update the local package cache. It shows how many packages can be upgraded at the end of the update command as shown below:
Make a Note:
The ‘apt’ package manager will only list available updates based on the ‘/etc/apt/sources.list’ file & ‘/etc/apt/sources.list.d’ directory on your system and won’t include other packaging formats like Flatpak, SNAP, etc,.
# apt update Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease Hit:2 http://in.archive.ubuntu.com/ubuntu jammy InRelease Hit:3 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease Hit:5 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done 9 packages can be upgraded. Run 'apt list --upgradable' to see them.
You can list what package can be upgraded using use the '--upgradable'
flag. It lists all upgradeable packages in alphabetical order with information about the currently installed version and the new available package version.
# apt list --upgradable
The above output consists of five parts, and the details are below:
Details:
- Package Name: libspeechd2
- Repo Name: jammy-updates
- Upgradable Version: 0.11.1-1ubuntu3
- Supported Architecture: amd64
- Installed Version: 0.11.1-1ubuntu2
To check only available ‘security’ updates, run:
# apt list --upgradable | grep "\-security"
Simulating an upgrade in Ubuntu
Alternatively, you can find the list of packages that can be upgraded in Ubuntu using the 'simulate'
flag with the apt or apt-get command. It perform a simulation of events that would occur based on the current system state but don’t actually change the system.
To check available update, run:
# apt -s upgrade or # apt-get -s upgrade
To check available package update count, run:
# apt -s upgrade | grep "^[[:digit:]]" or # apt-get -s upgrade | grep "^[[:digit:]]" 7 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Using apt-check
Alternatively, use the apt-check command to find out the number of packages available for upgrad in Ubuntu system.
To check package count, run:
# /usr/lib/update-notifier/apt-check --human-readable Expanded Security Maintenance for Applications is not enabled. 7 updates can be applied immediately. To see these additional updates run: apt list --upgradable 34 additional security updates can be applied with ESM Apps. Learn more about enabling ESM Apps service at https://ubuntu.com/esm
To check packages name, run:
# /usr/lib/update-notifier/apt-check -p speech-dispatcher-audio-plugins google-chrome-stable speech-dispatcher-espeak-ng python3-speechd speech-dispatcher libspeechd2 python3-debian
Final Thoughts
In this article, we covered how to check whether package updates are available in Ubuntu or not using three easiest method.