2

I just found out that there is a third command for installing packages available on my Debian GNU/linux distribution.

I found that I can install packages by simply entering:

apt install sl
            ^ package name

I prefer to use this command rather than apt-get or aptitude because it is easier to type and seems to do exactly the same thing.

But there might be some quirks with this that I am not aware of. Therefore I am wondering how apt is different from apt-get and aptitude.

Note that I am not asking for differences between apt-get and aptitude. There is already a question for that here.

I am asking how the apt command is different from apt-get and aptitude which the other question does not cover.

2

The apt command is a more recent addition to the apt package

   Date: Tue, 01 Apr 2014 17:04:42 +0000 
   .....
   [ Michael Vogt ]
   * install apt binary
   * add apt.8.xml manpage
   * make fancy-progress fg/bg color configurable via something like
     Dpkg::Progress-Fancy::Progress-{bg,fg}="%1b[30m"
     (thanks to Tim Wasser for the suggestion)
   * Add progressbar to "Dpkg::Progress-Fancy"
   * fix documentation for APT::Periodic::MaxSize "0" (closes: #740551)
   * Use mkstemp() in apt-extracttemplaes (closes: #741627)
   * Add new Debug::RunScripts debug option
   * do not crash on SIGPIPE in pkgDPkgPM::RunScriptsWithPkgs()
   * enable DPkg::Progress-Fancy by default when "apt" is used
   * refresh po/pot and unfuzzy apt-extracttemplate manpage change
   * remove no longer needed apt.7 page
   * install "apt" binary by default
   * add sun-java{5,6}-jdk to breaks/replaces as they provided a
     "apt" binary as well

Source

As far as I can tell from the blog of the person who did it, it basically combines the functionality of various apt commands:

APT 1.0 was released on the 1. April 2014 [0]! The first APT version was announced on the 1. April exactly 16 years ago [1].

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.

apt-get etc are lower level, and are used as backends for some things (mainly install scripts), and according to the manual using apt-get in scripts etc is preferable. if you want. I suppose this update is to make things simpler and make apt more like other package managers.

  • 2
    Well, part of the reason is to discard historical baggage. For obvious reasons, the behavior of the apt-cache and apt-get commands can't be changed. – Faheem Mitha Nov 21 '15 at 12:58
  • apt-get etc are lower level, and are used as backends for some things (probably including apt itself). I don't think that is true. The "probably including apt" bit is definitely untrue. What "some things" did you have in mind? Command line executables link directly to the apt library. And Python/Perl scripts use the apt Python/Perl bindings. – Faheem Mitha Nov 21 '15 at 13:00

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.