APT vs APT-GET: What's the Difference?

June 25, 2020

Introduction

Like many other Ubuntu users, you may have wondered – What is the difference between apt-get and apt? Or perhaps – When to use apt-get and when apt?

To answer these questions, you first need to understand when and why these command-line interfaces were created. Then, you can compare them side-by-side to see why to use one over the other.

In this tutorial, you will learn the difference between apt and apt-get.

Article explaining the differences between apt and apt-get.

What is the apt-get Command?

If you are a Linux user comfortable with the command line, apt-get is probably something you use often. You utilize this tool to install, update, list, and remove packages from your system.

apt-get is a command line program used to interact with the APT (Advanced Package Tool) package management system. However, this is just one of the tools used to communicate with the APT system. Along with apt-get, there are also apt-cacheapt-config, and (the newly added) apt.

Note: To learn more about the apt-get command and its basic usage, refer to the articles How to Use APT-GET in Linux and How To Use Apt-Get Reinstall On Debian And Ubuntu.

APT vs APT-GET: What is the Difference?

There are four main differences between apt and apt-get:

  1. The apt tool merges functionalities of apt-get and apt-cache
  2. Additional output and improved design
  3. Changes in command syntax for existing functionalities
  4. Two new functionalities exclusive to the apt command

1. APT Combines APT-GET and APT-CACHE Functionalities

Prior to Ubuntu 16.04, users regularly interacted with the APT package manager through the use of command line tools: apt-get, apt-cache, and apt-config. Although these tools offer many functionalities, most average users did not utilize all of the commands they provide.

Therefore, Linux wanted to create a simplified tool that only consisted of essential commands. With the release of Ubuntu 16.04 and Debian 8, they introduced a new command-line interface – apt.

The main goal for this novelty was to merge the most commonly used apt-get and apt-cache commands under the same command prefix.

Note: The apt command is more user-friendly compared to the existing APT tools. Also, it was simpler to use as you didn’t have to switch between apt-get and apt-cache.

2. Additional Output and Improved Design

Apart from the apparent differences between commands, apt also introduced changes to the output design.

Along with updating your local repository, the update command now includes an additional line displaying the number of packages that should be upgraded. There is a difference between updating and upgrading packages on your system. Therefore, this novelty serves as a useful reminder to upgrade the required packages.

Update package repository and see how many package are ready for upgrading.

Once the output displays the number of packages that can be upgraded, you can prompt the package manager to see a list of these packages. Run the apt list --upgradable command, and the output shows the specified list.

The output includes improved design for clearer representation with color emphasis.

List upgradable packages with the apt command.

Finally, the apt command added a progress bar displaying the upgrade process. This is a simple yet useful addition that gives the user more information about the given process.

Progress bar showing upgrade progress from apt upgrade.

3. apt vs apt-get Commands 

Although apt commands replace commonly used apt-get and apt-cache functions, they are not backward compatible with all of them. You cannot always replace the older package managers with apt.

In the table below, see the apt command for any given function, as well as which command it replaces.

Command FunctionExisting Commandapt Command
Update the package repositoryapt-get updateapt update
Upgrade packagesapt-get upgradeapt upgrade
Upgrade packages and remove unnecessary dependenciesapt-get dist-upgradeapt full-upgrade
Install a packageapt-get install [package_name]apt install [package_name]
Remove a packageapt-get remove [package_name]apt-remove [package_name]
Remove a package with configurationapt-get purge [package_name]apt purge [package_name]
Remove unnecessary dependenciesapt-get autoremoveapt autoremove
Search for a packageapt-get search [package_name]apt-get search [package_name]
Show package informationapt-cache show [package_name]apt show [package_name]
Show active package sourcesapt-cache policyapt policy
Show installed and available versions of a packageapt-cache policy [package_name]apt policy [package_name]

Note: If you need a one-page reference sheet with commands, you can use our downloadable Linux commands cheat sheet.

4. New apt Commands

Apart for simplifying existing commands, apt has a couple of its own. They were added to fulfill the needed command functions listed below.

Command FunctionNew apt Command
List packages by criteriaapt list
Edit sources listapt edit-sources

When to Use apt Instead of apt-get?

Most Linux users suggest using the apt command instead of apt-get whenever you can. Not only is it easier to type and remember, it performs tasks much faster.

Naturally, there are instances where substituting apt-get or apt-cache is not possible. Although you may still need to switch between command-line interfaces, many believe the apt command will eventually take over. For now, there is no official statement when or whether that will happen.

Conclusion

After reading this, you should have a better understanding of the differences between apt and apt-get. Using one or the other is a matter of habit. Therefore, try to get in the practice of using the apt command.

Was this article helpful?
YesNo
Sofija Simic
Sofija Simic is an aspiring Technical Writer at phoenixNAP. Alongside her educational background in teaching and writing, she has had a lifelong passion for information technology. She is committed to unscrambling confusing IT concepts and streamlining intricate software installations.
Next you should read
How to Use wget Command With Examples
October 22, 2019

Wget is a commonly used tool for downloading files in a command-line session. Not only is it fast and...
Read more
Linux Commands Cheat Sheet: With Examples
February 21, 2020

A list of all the important Linux commands in one place. Find the command you need, whenever you need it or...
Read more
How to Check Disk Space in Linux
April 13, 2020

This tutorial shows how to display disk usage from a command line in Linux. It is important to know how much...
Read more
How to Use fsck Command to Check and Repair Filesystem
May 14, 2020

If you want to keep your filesystems clean and without errors, you need to scan it on regular basis...
Read more
  • © 2021 Copyright phoenixNAP | Global IT Services. All Rights Reserved.