Debian is a Linux operating system widely used in web servers, despite being very friendly, we all need a push to understand how it works. As most servers do not have a graphical interface, since it is not recommended or necessary to have it, we have to use the terminal or console to make all the adjustments and installations for it to work. In order to update the software packages on Debian using apt, apt-get or aptitude, we need access as root in the terminal or use the sudo command before each command.
The most modern package manager is apt.
Update with different managers
With apt
To get the latest list of packages and then the new packages:
apt update
apt upgrade
To see the latest version of the available packages:
apt list --upgradable
With apt-get
Update list and update packages:
apt-get update
apt-get upgrade
To see the versions of the new packages available before updating:
apt-get -V upgrade
With aptitude
To do it with aptitude, it is basically the same. Get the latest list of software and update packages:
aptitude update
aptitude upgrade
If we want to know which version, we will update our packages to:
aptitude -V upgrade
Post-upgrade steps
Cleaning
To clean the downloaded packages according to each manager.
With apt
apt -y autoremove
apt clean
With apt-get
apt-get -y autoremove
apt-get clean
With aptitude
aptitude -y autoremove
aptitude clean
Conclusions
Finally, keeping the packages in our system updated is as important as their installation itself, since security problems are continuously solved, and best of all, improvements come out that could serve us in the future or in many cases increase the efficiency of the program.