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.
man apt-get
, orman aptitude
?