Apt vs Aptitude

Apt vs Aptitude

En distros basadas en Debian, el gestor de paquetes por defecto es dpkg, y permite instalar, desinstalar y administrar paquetes .deb en el sistema operativo. los paquetes en general cuentan con una serie de dependencias, esto es, paquetes que deben ser instalados previamente para poder instalar y/o usar la aplicación. Estas dependencias se gestionan mediante APT (Advanced Package Tool), una herramienta global de alto nivel que incluye a dpkg como backend, y que le agrega las funcionalidades de gestión de repositorios externos para dependencias y actualizaciones.

Por su parte, aptitude gestiona el marcado de paquetes también, y dispone de una interfaz opcional de curses que a muchos les facilita el trabajo en la terminal.


APT (Advanced Package Tool)


APT supports different front-ends or applications that make use of its services (API), and they can be for command line, graphical interface, etc. In its beginnings users got used to use a front-end called apt-get. Through this front-end you can install packages, uninstall, remove, etc. apt-get is part of a constellation of tools that also includes apt-cache for searches. apt does not guarantee backward compatibility with apt-get, but practically every command has its equivalent.

apt fixes some bugs of the original apt-get implementation, no bugs, application design errors, combines both functionalities in both commands and structures everything better, also provides features of most of the common apt-get and apt-cache commands, adding very useful information that previously required additional options.


Aptitude


An interface to apt, it displays a list of software packages and allows the user to interactively choose which ones to install or remove. It has a powerful search system that uses flexible search patterns, making it easy for the user to understand the complex dependency relationships that may exist between packages. It was originally designed for Debian GNU/Linux distributions, but today it can also be used on RPM package-based distributions.

aptitude is based on a library ncurses, by which it provides an interface, which is known to resolve dependencies better than apt-get and eliminate useless packages and incorporates some elements common to other graphical interfaces, such as drop-down menus.


Difference between commands

Now we will put some help commands to use these tools and see their differences according to their function.

Install package

apt install <pkg> 
apt-get install <pkg>
aptitude install <pkg>


Uninstall package

apt remove <pkg>
apt-get remove <pkg>
aptitude remove <pkg>


Delete pkg and its configuration

apt purge <pkg>
apt-get purge <pkg>
aptitude purge <pkg>


Update repositories

apt update
apt-get update
aptitude update


Upgrade packages (without removing or reinstalling)

apt upgrade
apt-get upgrade
aptitude safe-upgrade


Updating packages (removing and reinstalling if necessary)

apt full-upgrade
apt-get dist-upgrade
aptitude full-upgrade


Eliminate unnecessary dependencies

apt autoremove
apt-get autoremove
aptitude autoremove


Search package

apt search <pkg>
apt-cache search <pkg>
aptitude search <pkg>


Display package info

apt show <pkg>
apt-cache show <pkg>
aptitude show <pkg>


Display status and installation candidate

apt policy <pkg>
apt-cache policy <pkg>
aptitude policy <pkg>


Show sources to repositories

apt policy
apt-cache policy
aptitude policy


Editing source repositories

apt edit-sources


List packages by name

dpkg -l | grep <name>


There are more commands in these tools, these are the most used when updating and managing packages, I hope they have been useful for you!


Differece of APT and Aptitude


Now that we have a good understanding of what APT and Aptitude has to offer, it is now time to learn about their difference.

The first difference you will notice is that APT is a lower-level package manager, and Aptitude is a high-level package manager. This means that APT can be used in other higher-level package managers.

Another big difference is the functionality offered by both of the tools. aptitude offers better functionality compared to apt-get. In fact, it contains the functionalities of apt-get, apt-mark, and apt-cache.

For instance, apt-get can be used effectively for package up-gradation, installation, resolving dependencies, system up-gradation, and so on. However, Aptitude offers more features thanks to the inclusion of functionalities of apt-cache and apt-mark. This means Aptitude can be used for more functionality, including package search, setting package installation as automation or manual, and more refined actions on the packages.

Which one is better, and which one should you use? In simple terms, you can use any of them considering that your requirement is met. If you find the APT command tool to benefit your work, then, by all means, use it for doing your work. Both are capable of providing the necessary means to do package management!