.deb is a software package file containing application files of a particular software and metadata file about its dependencies and versions. The software can be installed from the deb file using dpkg (Debian Package Manager) from the command line or from graphical applications (which use dpkg in the backend).
This format is used in all Debian-based Linux distributions, for example, Ubuntu, Linux Mint, etc. Usually, these distributions have another installation utility that runs on top of dpkg and performs the task of dependency management, which is done by the apt package manager.
Today, we will learn how to list upgradable deb packages, i.e. packages for which a newer version is available in the repositories, in Ubuntu, Debian & Mint.
Update Software Repository Files
First, we need to update the repository index files, which contain metadata of the latest packages available in the repository. To do this, run:
$ sudo apt update
As shown in the output, apt has fetched the latest index files from different repositories (main, universe, restricted). If you pay attention to the last line of output, it tells us that 131 packages can be upgraded, i.e., newer versions are available, and it also literally tells us the apt command to see these packages.
List All Upgradable Packages in Ubuntu
Thus, run the following command to see these upgradable packages.
$ apt list --upgradable
It shows the name of the package, its newly available version number, and the version number of the already installed package.
Upgrade Packages in Ubuntu
You can now run the following command to upgrade all these packages to the latest available version.
$ sudo apt upgrade
We have learned about deb packages and how the upgradable packages can be listed in Ubuntu using the apt command. Installation, upgradation, and removal of packages are thus quite simplified by apt, instead of directly using dpkg and manually taking the hassle of dependency management.
Learn more about dpkg and apt in their man pages:
$ man dpkg $ man apt
If you have any questions or feedback, let us know in the comments below!