Apt- * or Aptitude, which one to use?

Apt (Advanced Ppackaging TOol) is basically used for installing and uninstalling packages in GNU / Linux. The ones we use Debian and derivatives, we use it normally, although we can also use Aptitude.

Do you know what the difference is between the two? I didn't know them either, so I started doing some research and doing some experiments. Here I show you the result.

fitness.

It is said that Aptitude is an improved version of Apt and manages package dependencies much better and is even recommended by Debian. Aptitude includes many more options than Apt, Let's see the most used and their description according to the help of aptitude.

install : Install one or more packages. The packages should appear after the "install" command.
remove, purge, hold, unhold, keep, reinstall : These commands do the same as "install", but in this case the named action would affect all those packages on the command line that do not invalidate it.
Update : Update the list of available packages from apt sources (equivalent to "apt-get update").
safe-upgrade : Update installed packages to their latest version. Installed packages will be removed unless they are not used.
full upgrade : Update installed packages to their latest version, installing or removing packages if necessary. This command is less conservative than safe-upgrade, and therefore more prone to unwanted actions. However, it is capable of updating packages that safe-upgrade is unable to update. For historical reasons, the command was originally called dist-upgrade, and aptitude still recognizes dist-upgrade as a synonym for full-upgrade.
search : Find packages that match one of the patterns entered on the command line.
Show : Show detailed information related to one or more packages, listed according to the «search» command.

To see more information about aptitude and its options, we can use one of the best ways to find help, putting in the console:

$man aptitude

Apt

In the case of Apt, it is used by the commands: apt-cache, apt-get, apt.conf, apt_preferences, apt-secure, the first 2 being the most used. The options included are the following:

Update : update is used to synchronize the package index from their sources.
upgrade : upgrade is used to install the newest version of all packages installed on the system from any of the sources listed in /etc/apt/sources.list.
dist-upgrade : In addition to performing upgrade actions, it intelligently handles dependency changes due to new package versions. apt-get has a "smart" conflict resolution system, and if necessary it will try to update the most important packages at the expense of the less important ones.
install : Install or update the packages that follow the word "install".
remove : It behaves in the same way as install with the difference that it removes the packages instead of installing them. Note that when removing a package, its configuration files remain on the system. If a plus sign precedes the package name (without any white space between the two), the package in question will be installed instead of removed.
purge : It is identical to remove, with the difference that the packages will be removed and purged (any configuration files will also be removed).

To see more information about aptitude and its options, we can use one of the best ways to find help, putting in the console:

$ man apt-get.

What is the difference then?

In reality it all depends on the use that each person gives it and what they need to do. In particular I always use aptitude, as it has many more options, but in case I have to do searches, apt-cache is more interesting to me. Also, aptitude has a console interface:

I have read in some places that aptitude it also installs the suggested dependencies, and that apt-get only install the recommended ones. However, if we try to install Audacious for example, we will see that it installs the same packages.

Let's see when installing audacious with aptitude:

sudo aptitude install audacious
The following NEW packages will be installed:
  audacious audacious-plugins {a} libaudclient2 {a} libaudcore1 {a} libbinio1ldbl {a} libcue1 {a} libfluidsynth1 {a} 
  libmcs1 {a} libmowgli2 {a} libreid-builder0c2a {a} libsidplay2 {a} unzip {a} 
0 updated packages, 12 new ones installed, 0 to remove and 0 not updated. I need to download 3494 kB of files. After unpacking, 11,0 MB will be used.

and now with apt-get:

sudo apt-get install audacious
Reading package list ... Done Creating dependency tree Reading status information ... Done The following extra packages will be installed:
  audacious-plugins libaudclient2 libaudcore1 libbinio1ldbl libcue1 libfluidsynth1 libmcs1 libmowgli2 libreid-builder0c2a
  libsidplay2 unzip
Suggested Packages:
  libmcs-backend-gconf libmcs-utils zip
The following NEW packages will be installed:
  audacious audacious-plugins libaudclient2 libaudcore1 libbinio1ldbl libcue1 libfluidsynth1 libmcs1 libmowgli2
  libreid-builder0c2a libsidplay2 unzip
0 updated, 12 will be installed, 0 to remove, and 0 not updated. I need to download 3494 kB of files. 11,0 MB of additional disk space will be used after this operation.

To see another difference we can do a search. For example, open a terminal and type:

aptitude search ipod

and then

apt-cache search ipod

As you can appreciate the search with apt-cache it was the most satisfactory. In the case of aptitude, it only searched by package name, however, apt-cache You searched for all the programs or packages that are related to the word ipod, probably by the description of each package.

Conclusions

Use the one that is most comfortable for you. It's easier for me to use aptitude because it is a single command, however with apt I have to use apt-get o apt-cache according to the case. If you know of any other differences, leave them in the comments 😀


12 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Yoyo said

    I've always been faithful to aptitude 😉

    1.    elav <° Linux said

      We are already 2 😀

  2.   mcder3 said

    Missing "aptitude purge packagename" to remove package + dependencies + package settings (root level)

    Very good entry and congratulations on the blog 😛

    regards

    1.    mcder3 said

      I already saw it lol ... sorry for putting the "aptitude purge" thing XD

      1.    KZKG ^ Gaara said

        Nothing, do not worry (I.e.
        Thank you for your comments, because the intention I am sure was to help 😉
        Greetings and keep stopping by here 🙂

      2.    elav <° Linux said

        No problem .. Thanks for wanting to help .. 😀

  3.   Jesus Ballesteros said

    When I use Debian I also prefer aptitude, it gives me more confidence :). But I also agree with you that apt-get is more effective when it comes to searching. I don't know if aptitude will one day use something similar to apt-cache or maybe in the future they will remove apt-get and leave aptitude and apt-cache: P ...

  4.   July said

    Until now I had used APT-GET, I will approve APTITUDE to see ...

  5.   Jose Luis Mantilla said

    Of course there is a very remarkable difference !!

    Apt: you install the package with the required libraries

    Aptitude: it installs the required, suggested ones and before installing it verifies that it does not damage another package that shares libraries of other versions, before installing it solves existing conflicts between applications that even run the same port or that have something wrong in their configuration and you Ask how you want to solve it with their respective suggestions and explanation and finally with Aptitude you will NEVER have broken packages (you will not need clean or autoclean or apt -f install to correct), this works like this from 6,5 and 7 !!

    Good morning and to serve you (greetings from Colombia)

  6.   unknown channel said

    Hey.
    And what is the APT install command? I notice that they mention it in the pdf Tutorial that Linux Mint has on its website.
    And its author recommends not doing apt-get upgrade of Updates by Terminal, since it does not filter what kind of stability levels they belong, as if it is available in the Updater with Mint's graphical interface.

  7.   franc said

    Even knowing this, I use apt-get more often than aptitude. But I know that the synaptic package manager uses aptitude every time you install something in graphical mode.

  8.   pepo said

    For many years the APT command includes the apt-get and apt-cache functionalities, so that we can make "apt install package" and "apt search package" instead of "apt-get install package" and "apt- cache search package »respectively.