Use apt or apt-get on Linux?

Should we use apt or apt-get on Linux? Advanced Package Tool apt and apt-get are both command-line tools for handling packages on Debian and Debian based Linux distributions such as Ubuntu and Linux Mint.

Linux users who update Linux from the command line on Debian based systems are familiar with “sudo apt-get update” and “sudo apt-get upgrade” to find and install updates from the command line. Lately these commands have been simplified to “sudo apt update” and “sudo apt upgrade“.

Use apt or apt-get on Linux?

apt or apt-get Quick Answer

Should we use apt or apt-get? The short answer is that apt is newer and should be used instead of the older and lower level apt-get.

To get the list of updated packages with apt, use the following command:

sudo apt update

After updating the package list, upgrade packages using the following command:

sudo apt upgrade

More About Using apt or apt-get

Everything that we need to know about apt and apt-get can be found in Debian documentation. This documentation can be found online and also on the Linux system itself.

Debian Administrator’s Handbook

The Debian Administrator’s Handbook is available online. In this book, the section on aptitude, apt-get and apt commands provides more information on APT and the apt command.

An explanation in the handbook shows the origin of the apt command, which is included below:

APT is a vast project, whose original plans included a graphical interface. It is based on a library which contains the core application, and apt-get is the first front end — command-line based — which was developed within the project. apt is a second command-line based front end provided by APT which overcomes some design mistakes of apt-get.

Debian Manpages

Another source of answers is found in the Debian Manpages. Manpages are also accessible at the command line of a Debian based distribution.

From the apt Manpages, the following description about apt can be found:

apt (Advanced Package Tool) is the command-line tool for handling packages. It provides a command-line interface for the package management of the system. See also apt-get(8) and apt-cache(8) for more low-level command options.

It also provides the following differences of apt to apt-get:

The apt command is meant to be pleasant for end users and does not need to be backward compatible like apt-get(8). Therefore some options are different:

  • The option DPkg::Progress-Fancy is enabled.
  • The option APT::Color is enabled.
  • A new list command is available similar to dpkg –list.
  • The option upgrade has –with-new-pkgs enabled by default.

From the command line of a Debian distribution, more information on apt and apt-get is accessible using the man command:

man apt

And:

man apt-get

Leave a Reply

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