apt-get provides online package update for the deb based distributions. We can list currently available updates of the current system with these apt and apt-get commands in different ways. We can list updateable or upgradeable packages for Linux distributions like Ubuntu, Debian, Mint, Kali etc.
Update Repository/Packages Information
In order to list available package updates, we have to get the latest updates from package repositories. So first we will get latest updates one of the following commands.
$ sudo apt update
$ sudo apt update
We can see in the last line of the screenshot that the total numbers of the available updates are provided which is 3 in this case.
List Available Updates with apt
Now we can list available updates with the
apt command by providing
list --upgradeable options.
$ apt list --upgradeable
We can see that the following information about the updateable packages is provided.
- `name` of the package
- `repository` of the package
- `newer version` of the package
- `older or current version` of the package
List Available Updates with apt-get
We can also use
apt-get command with the specified options where it will provide less information according to
$ sudo apt-get -u upgrade --assume-no
We can see from the screenshot that only the updateable package names are provided.
List Available Updates with aptitude
We can use
aptitude command in order to list upgradeable packages. We will use the
search option where to select the upgrade flagged packages.
$ aptitude search '~U'
Install/Upgrade Available Package Updates with apt, apt-get and aptitude
We can update/upgrade available updates with
aptitude commands like below.
$ sudo apt dist-upgrade -y
$ sudo apt-get dist-upgrade -y
$ sudo aptitude safe-upgrade