2

Having used apt-get and seeing aptitude for the first time, I thought that apt must just be short for aptitude so when told to type aptitude install, I just typed apt install.

It seems to have worked, but have I done what needed to be done or has something been missed?

3
  • 3
    Have you tried man apt-get, or man aptitude? – eyoung100 Sep 15 '14 at 17:26
  • 4
    I'm not very familiar with the rules here at StackExchange, but I upvoted this question, because I think this is a legit beginner question. I imagine someone being totally new trying to learn. Also, I see that the answer has 5 upvotes, doesn't that alone give credit to the asker? – Sebastian Sep 15 '14 at 21:31
  • 2
    @Sebastian Excellent feedback, all to often I see questions downvoted with no explanation whatsoever. You also bring another factor into the equation and that is that the answers ARE upvoted. To me that is indeed a great indication that the question holds substance. I think we should embrace newcomers to the Unix and Linux field to make this site even better. – captcha Sep 15 '14 at 22:28
9

aptitude install means that you are invoking the install target of the aptitude program.

apt install means you are invoking the install target of the apt binary. Note that the apt binary is very new. It arrived with the 1.0 release. And no, it is not short for aptitude, but is a separate binary.

Both these commands install the packages that are given as arguments. However, apt and aptitude each use their own dependency resolution algorithms (which choose which packages to install to satisfy the request), which are different. This means in practice that they may choose different packages to install as a result of the same package arguments. E.g.

apt-get install foo

and

aptitude install foo

may choose to install different packages.

Note also that one rather noticeable difference between the two commands is aptitudes interactive dependency resolver. This will give you different choices on how to install the package, ranging from the reasonable to the insane. Daniel Burrows, the author of aptitude, was rather proud of having discovered this algorithm.

The apt binary is contained in the apt software binary package (deb), which also includes apt-get and apt-cache. apt is a newer command than the other two and is intended to be friendlier. As far as I know apt-get install and apt install are functionally equivalent.

The aptitude binary is contained in the aptitude software binary package (deb).

To find out more about these commands you can do e.g.

man apt

to see the man page and

apt --help

to see the help output, and similarly for the other commands mentioned here.

Here is Michael Vogt, long time apt developer, on the subject of the new apt binary. He writes

The big news for this version is that we included a new “apt” binary that combines the most commonly used commands from apt-get and apt-cache. The commands are the same as their apt-get/apt-cache counterparts but with slightly different configuration options.

Currently the apt binary supports the following commands:

  • list: which is similar to dpkg list and can be used with flags like --installed or --upgradable.

  • search: works just like apt-cache search but sorted alphabetically.

  • show: works like apt-cache show but hide some details that people are less likely to care about (like the hashes). The full record is still available via apt-cache show of course.

  • update: just like the regular apt-get update with color output enabled.

  • install,remove: adds progress output during the dpkg run.

  • upgrade: the same as apt-get dist-upgrade –with-new-pkgs.

  • full-upgrade: a more meaningful name for dist-upgrade.

  • edit-sources: edit sources.list using $EDITOR.

PS: If the Super Cow Powers thing puzzles you, you're not the only one.

PPS: NB: aptitude, apt, apt-get, apt-cache all use the shared apt library, which lives in (you guessed it) the apt package, so they have a lot of common code. Try running

ldd /usr/bin/apt

or

ldd /usr/bin/aptitude

and you'll see a line like

libapt-pkg.so.4.12 => /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12 (0x00007fd065330000)

That is apt/aptitude linking against the shared apt library. But the dependency resolver is not one of the things they share.

2
  • 1
    From my experience, due to their different dependency resolution, it is not recommended to mix aptitude and apt. I've had many issues with aptitude trying to uninstall packages installed by apt. Also, apt seems to be the most intelligent in more recent versions of Debian. – Teresa e Junior Sep 15 '14 at 22:22
  • Well, aptitude hasn't been maintained for a while, while apt is. – Faheem Mitha Sep 15 '14 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.