How To List Available Updates and Updateable Packages with Apt, Apt-Get, Aptitude Commands?
apt
and 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.
1 |
$ sudo apt update |
OR
1 |
$ sudo apt update |

Update Repository/Packages Information
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.
1 |
$ apt list --upgradeable |

List Available Updates with apt
We can see that the following information about the updateable packages is provided.
name
of the packagerepository
of the packagenewer version
of the packageolder 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 apt
command.
1 |
$ sudo apt-get -u upgrade --assume-no |

List Available Updates with apt-get
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.
1 |
$ aptitude search '~U' |

List Available Updates with aptitude
Install/Upgrade Available Package Updates with apt, apt-get and aptitude
We can update/upgrade available updates with apt
, apt-get
and aptitude
commands like below.
1 |
$ sudo apt dist-upgrade -y |
OR
1 |
$ sudo apt-get dist-upgrade -y |
OR
1 |
$ sudo aptitude safe-upgrade |

Install/Upgrade Available Package Updates with apt, apt-get and aptitude