DevHeads.net

apt and apt-get

Hi,

I am running ubuntu-18.04, which has both apt and apt-get for package
management.

$ apt-get -v
apt 1.6.10 (amd64)

$ apt -v
apt 1.6.10 (amd64)

Are these two programs the same one? which is suggested?

Thanks.

Comments

Re: apt and apt-get

By Liam Proven at 08/09/2019 - 07:28

On Fri, 9 Aug 2019 at 11:17, Eliza < ... at chinabuckets dot com> wrote:
It's worse, there's aptitude too.

APT is the family of tools; historically ``apt-get'' was one of the
many sub-tools. ``apt'' was another.

Debian decided this wasn't ideal and put quite a lot of effort into
``aptitude'' which is a more powerful replacement and wraps up various
other tools.

Ubuntu is a descendant of Debian but focusses less on power and more
on friendliness.

So it enhanced the ``apt'' tool a bit to make it easier to do common stuff.

So formerly the official way to do some stuff was:

apt-get update
(refresh your local index of what's in the online software repositories)

apt-get install [appname]
(install this new app)

apt-get upgrade

(upgrade to the latest version of all apps)

apt-get dist-upgrade
(upgrade the whole distro including installing new apps if needed)

But

apt-search [appname]
to find something

and

apt-cache clean
to clean up the local package cache

Now ``apt'' makes it a bit easier and with less typing.

apt udate
apt install [appname]
apt full-upgrade

You only need the one command, not 3 or 4 sub-commands.

Re: apt and apt-get

By Colin Watson at 08/09/2019 - 09:47

On Fri, Aug 09, 2019 at 02:28:31PM +0200, Liam Proven wrote:
The "apt" program, as opposed to the "apt" package name, only came into
existence in 2013/2014 or so, long after aptitude, so the existence of
both apt-get and apt can't possibly have been part of the motivation for
the creation of aptitude. (There were always people in Debian working
on both apt and aptitude in different directions; apt supplied a
significant amount of core library code to both frontends.)

I believe that the "apt" frontend program was originally called
"apt-get" mainly because the "apt" name was taken by something else
(IIRC some Java build tool?), now long since obsolete.

While Ubuntu developers have certainly been heavily involved in apt
maintenance and on the "apt" program, for the most part they've been
doing that work in Debian. It's not in either Debian's or Ubuntu's
interests to have very much divergence in apt code, and for example the
version of apt (1.6.1) that shipped in the original release of Ubuntu
18.04 was a verbatim copy of one that was uploaded to Debian.

Debian experimental has exactly the same version of apt as Ubuntu 19.10
right now.

Re: apt and apt-get

By Robert Heller at 08/09/2019 - 06:23

Different programs (different syntax), same effective function. I believe
apt-get is being phased out in favor of apt.

Re: apt and apt-get

By Francis (Grizzl... at 08/09/2019 - 06:33

On 09/08/2019 21:23, Robert Heller wrote:

Re: apt and apt-get

By Colin Watson at 08/09/2019 - 05:08

On Fri, Aug 09, 2019 at 05:14:33PM +0800, Eliza wrote:
"man apt" says:

apt provides a high-level commandline interface for the package
management system. It is intended as an end user interface and enables
some options better suited for interactive usage by default compared to
more specialized APT tools like apt-get(8) and apt-cache(8).

Both of these programs are relatively simple frontends over the same
library code, so it's safe to use either one, but "apt" has better
defaults and if you're new to the system you should start with that.

Re: apt and apt-get

By Colin Law at 08/09/2019 - 05:25

On Fri, 9 Aug 2019 at 11:11, Colin Watson < ... at ubuntu dot com> wrote:
In addition apt simplifies things combining other commands. For
example previously apt-cache could be used in this way
apt-cache policy <package>
now one can do
apt policy <package>

Colin