Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: March 14, 2025
In Linux, a package can be a program file, library, configuration file, or tool installed on the system and managed by a package manager. Packages simplify the distribution and management of software, making it easier to install, upgrade, and remove applications.
Regularly updating packages ensures we have the latest software versions, bug fixes, and security patches. Luckily, identifying and updating packages in Linux is straightforward through the command line.
In this tutorial, we’ll explore how to check for available package updates in Linux.
Debian-based distributions use the apt package manager to install, update, and remove packages. Let’s check for available package updates in Debian-based distributions.
First, we must ensure our system has the latest information about the available packages. To do this, we’ll need to run the apt update command to update the list of available packages from all the repositories and PPAs. Once we’ve got the updated list of packages, we can check which packages need updating:
$ sudo apt list --upgradable
Listing... Done
alt-curlssl/unknown 8.11.0-2 amd64 [upgradable from: 7.87.0-1]
alt-libcurlssl/unknown 8.11.0-2 amd64 [upgradable from: 7.87.0-1]
apparmor/jammy-security 3.0.4-2ubuntu2.3build2 amd64 [upgradable from: 3.0.4-2ubuntu2.3]
busybox-initramfs/jammy-security 1:1.30.1-7ubuntu3.1 amd64 [upgradable from: 1:1.30.1-7ubuntu3]
busybox-static/jammy-security 1:1.30.1-7ubuntu3.1 amd64 [upgradable from: 1:1.30.1-7ubuntu3]
curl/jammy-security 7.81.0-1ubuntu1.18 amd64 [upgradable from: 7.81.0-1ubuntu1.17]
ea-apache24-config-runtime/unknown 1.0-193+198.1.cpanel amd64 [upgradable from: 1.0-193+197.1.cpanel]
ea-apache24-config/unknown 1.0-193+198.1.cpanel amd64 [upgradable from: 1.0-193+197.1.cpanel]
The output displays the list of all the installed packages that can be upgraded. The packages in the list include information on the current version along with the version available for upgrade.
For example, if we look at the first line of the output, we can see that the alt-curlssl is installed with version 7.87.0-1 and can be upgraded to 8.11.0-2.
Next, to check if a specific package has an update available, append the package name to the apt list –upgradable command:
$ sudo apt list --upgradable openssl
Listing... Done
openssl/jammy-security 3.0.2-0ubuntu1.18 amd64 [upgradable from: 3.0.2-0ubuntu1.17]
N: There are 3 additional versions. Please use the '-a' switch to see them.
This command shows the latest version available for openssl. However, to check all available updates for a specific package, we can use the -a or –all-versions option:
$ sudo apt list --upgradable -a openssl
Listing... Done
openssl/jammy-security 3.0.2-0ubuntu1.18 amd64 [upgradable from: 3.0.2-0ubuntu1.17]
openssl/now 3.0.2-0ubuntu1.17 amd64 [installed,upgradable to: 3.0.2-0ubuntu1.18]
openssl/jammy-updates 3.0.2-0ubuntu1.14 amd64
openssl/jammy 3.0.2-0ubuntu1 amd64
Once we have identified the updates, we can also upgrade the package using the apt command.
In the case of RPM-based distributions, we can use the yum or dnf package manager for package management. To check for available package updates in RPM-based distributions, we can use the yum check-update command:
$ yum check-update
Last metadata expiration check: 1 day, 7:51:21 ago on Fri 07 Mar 2025 12:33:16 AM PST.
This command queries the repositories for newer versions of the installed packages and lists them if any are found.
Next, to check if an update is available for a particular package, we can use the yum list command followed by the package name. For instance, let’s check if any update is available for the wireshark package:
$ yum list 'wireshark*'
Last metadata expiration check: 1 day, 8:37:22 ago on Fri 07 Mar 2025 12:33:16 AM PST.
Installed Packages
wireshark.x86_64 1:2.6.2-14.el8 @appstream
wireshark-cli.x86_64 1:2.6.2-14.el8 @appstream
Available Packages
wireshark-cli.i686
The yum list command displays all packages available for installation in the repositories, as well as those already installed on the system. By using the wireshark* regex pattern, we’ve filtered the results to show only the packages that match the wireshark prefix.
If we’re using Arch-based distributions, we can use pamac for package management, including package updates:
$ pamac update --dry-run
Preparing...
Resolving dependencies...
Checking inter-conflicts...
To upgrade (1136):
linux-api-headers 6.13-1 (5.17.5-2) core 1.3 MB
tzdata 2025a-1 (2022a-1) core 354.6 kB
iana-etc 20241206-1 (20220603-1) core 408.6 kB
filesystem 2024.11.25-2 (2022.06.08-3) core 40.9 kB
glibc 2.41+r9+ga900dbaf70f0-1 (2.35-6) core 10.5 MB
a52dec 0.8.0-2 (0.7.4-11) extra 47.4 kB
gcc-libs 14.2.1+r753+g1cd744a6828f-1 (12.1.0-2) core 36.7 MB
ncurses 6.5-3 (6.3-3) core 1.2 MB
The pamac update command is used to upgrade packages. However, when used with the –dry-run option, it simulates the update process without actually performing the upgrade.
To check if a particular package needs an update, we can combine pamac update with the grep command:
$ pamac update --dry-run | grep -w ufw
ufw 0.36.2-5 (0.36.1-1) extra 145.5 kB
The output shows that an update is available for ufw. The currently installed version is 0.36.1-1, and the available update is 0.36.2-5.
Another command we can use to check for package updates in Arch-based distributions is pamac checkupdates:
$ pamac checkupdates
available updates:
a52dec 0.7.4-11 -> 0.8.0-2 extra
aalib 1.4rc5-14 -> 1.4rc5-18 extra
abseil-cpp 20211102.0-2 -> 20240722.1-1 extra
accountsservice 22.08.8-2 -> 23.13.9-2 extra
acl 2.3.1-2 -> 2.3.2-1 core
acpi 1.7-3 -> 1.7-4 extra
acpid 2.0.33-1 -> 2.0.34-2
Similarly, we can check for updates for a particular package by filtering the output of the pamac checkupdates command using grep:
$ pamac checkupdates | grep -w ufw
ufw 0.36.1-1 -> 0.36.2-5
The output shows both the current and the available versions of ufw.
In this article, we’ve covered how to find updates for installed packages in Debian, RPM, and Arch-based distributions. The apt package manager in Debian, dnf or yum in RPM-based systems, and pamac in Arch-based distributions provide straightforward methods to check for available package updates.
Additionally, we can use these package managers to update the packages as well. Regularly checking for updates and keeping packages up-to-date ensures that the system remains secure and operates efficiently.