Apt Vs Apt-get What’s the Difference?

Package management tools for Debian-based Linux systems like Ubuntu include apt and apt-get. Although they have certain similarities, they also differ in some ways. If you understand the differences between the two packages then you will be able to manage the software effectively. In this article, I will show the comparison between apt vs apt-get. This will help you to distinguish between these two popular package managers.

What is Apt?

In Debian-based distributions, the installation and removal of software are generally managed through the package management system known as the Advanced Package Tool (APT). It makes use of tools to manage, update, install, and uninstall operating system packages.

What is Apt-get?

A command-line utility for managing packages in Linux is called apt-get. Its primary duty is to retrieve data and packages from trusted sources for use in the installation, upgrade, and removal of packages and the dependencies on those packages.

Differences Between Apt and Apt-get

The difference between apt and apt-get is not that apt is newer; besides, it provides a progress bar, simple syntax which makes it easier to memorize, and also shows differences in features. So I have shown three differences between Apt and Apt-get.

1. Visual Differences

If you use the apt command instead of apt-get, you will see some visual differences. Below I will show you those differences:

A. Progress Bar

Firstly when you use apt while installing, or removing a package you will see a progress bar that is not available for apt-get. Here, I will install the synaptic package. You can choose any of your liking. Copy the below command to install the package:

sudo apt install synaptic
EXPLANATION
  • sudo: Permits administrative privileges.
  • apt: Provides a high-level command line interface for the package management system.
  • install: Command installs the specified package.
  • synaptic: Package name which I want to install.

Install Synaptic with apt

Progress bar shown

From the images, you can see the progress bar at the bottom which shows the progress in percentage (40%) for apt.

Next, I will install the package using the apt-get command.

sudo apt-get install synaptic
EXPLANATION
  • apt-get: Provides a front-end command line interface for the package system.

Install synaptic package with apt-get package manager

While installing with apt-get no progress bar has been shown

From the above images, you can see there is no progress bar at the bottom. So, you can now be able to differentiate between apt and apt-get visually.

B. Update and Upgradable List

With the apt tool when you use the update command it also shows how many packages can be upgraded. You can copy and run the following command on Ubuntu:

sudo apt update
EXPLANATION
  • update: Command to make packages up to date.

The repository packages are updated with aptFrom the image you can see, 123 packages can be upgraded. You can also see the upgradable package list.

Here is the command to see the list of the packages that need to be upgraded using apt. You can copy the command from here:

sudo apt list  --upgradable
EXPLANATION
  • list: Shows the list of the following command.
  • upgradable: Upgradable package.

Upgradable package list has been shown with apt

From the above image, you can see as I run the command it shows the list of the upgradable packages.

But when I used apt-get to update the installed packages it did not show any upgradable list.

Here is the command which I used for updating with apt-get.

sudo apt-get update

Update with apt-get which not show the upgradable package list

From the image, you can observe that there are no upgradable packages shown at the bottom.

2. Syntax Differences Between Apt and Apt-get

The syntax of apt and apt-get is quite similar but there is some syntax in apt-get that was not easy to memorize. Here are some of the common syntaxes shown in the table:

Functions Apt-get Apt
Install a package apt-get install [package] apt install [package]
Remove a package apt-get remove [package] apt remove [package]
Update repository index apt-get update apt update
Upgrade available packages apt-get upgrade apt upgrade
Remove the package with the configuration apt-get purge[package] apt purge[package]
Search for a package apt-cache search[package] apt search [package]
Remove unnecessary dependencies apt-get autoremove apt autoremove
Show package details apt-cache show[package] apt show [package]
Show active packages apt-cache policy apt policy
Remove old packages if needed to upgrade new packages apt-get dist-upgrade apt full-upgrade

3. Comparing Features Between Apt and Apt-get

From the above discussion, you can see apt is not only a new version of apt-get it also provides some benefits to the user which leads the user towards using apt instead of apt-get. For some features, both show different results. In the following table comparison between apt and apt-get is shown.

Feature Apt Apt-get
Compatibility
  • As apt-get is used for compatibility purposes, it is meant to replace apt-get and other older tools
  • Widely used and is included in the latest Ubuntu versions.
Options
  • For greater flexibility, we can use more options and sub-commands.
  • Compared with apt, it has fewer options and sub-commands.
Verbosity
  • For increasing verbosity, apt use the verbose flag.
  • apt-get use V-flag
Resolve conflict
  • While installing packages, dependency conflict is automatically resolved.
  • As it cannot resolve dependency automatically, which can fail to install packages.
Parallel downloads
  • Using a parallel flag, multi-package can be downloaded at a time which can speed up the process of installation.
  • In apt there is no parallel flag, for that reason simultaneously downloading multiple packages is not possible.
Interactive mode
  • Apt has an interactive mode that helps you to review and confirm changes while making significant changes.
  • It has no interactive mode.

How Does Apt Replace Apt-get?

To reduce the dependency limitation of apt-get, apt was introduced. When you want to install a package with apt-get, you have to use ‘apt-get install [package name]’. But if you want to install that package with apt then you have to type ‘apt install [package]’.

If you want to search for a package with apt-get then you have to use ‘apt-get search[package]’ and with apt you have to use ‘apt search[package]’.

Again, if you want to list the packages you have to use ‘dpkg -list’ but for apt you have to use ‘apt list’.

The blockdiagram shows the combination of apt

So from the image shown above, you can see that the apt is the combination of apt-get,apt-cache, and dpkg -l.

Is Apt-get Deprecated?

No, apt-get is not deprecated. Apt is getting more popular day by day for its better compatibility and it can be used in all the newer versions of Debian. But there are still some users who depend on apt-get because of its backward compatibility and more detailed control.

When to Use Apt Instead of Apt-get?

As apt is user-friendly and shows a progress bar, when you need to see the progress of downloading and installing then you have to use apt instead of apt-get. Besides this, there is some syntax of apt-get which is not user-friendly and hard to memorize for searching “Package” apt search is used for apt but apt-cache search is used for apt-get because apt-get is not supporting the search.

Should You Use Apt or Apt-get?

You can use both of the commands but it is better to use apt instead of apt-get. As the new version of Debian is not supported by apt-get, so for the newer version you have to use the apt command. apt shows a progress percentage while installing, or removing any package, so you can estimate the installing time or removing time which will be user-friendly.

Similarities Between Apt and Apt-get

Despite the differences above I mentioned, there are some similarities. Here are the similarities between apt and apt-get.

  • apt and apt-get are both package management tools that are used for package installation, update, and removal of packages.
  • Between these two tools, many of the options and commands are quite similar. You can use apt-get install “package” for apt-get and apt install “package” for apt.
  • Both of these share some same options, and their configuration file is the same for the repository.

Examples of Using apt and apt-get

Using apt and apt-get you can install, update, remove a package, and upgrade an installed package also. You can search for a package and also show the information about the package. Here I will show some examples of these two:

Example 1: How to Install a Package with apt

To install an apt package in Ubuntu copy this command. Here I will install vlc, you can choose any package according to your liking.

sudo apt install vlc
EXPLANATION
  • sudo: Permits administrative privileges.
  • apt: Provides a high-level command line interface for the package management system.
  • install: command install the following package.
  • vlc: The package which I want to install.

Vlc package installed with aptFrom the above image, you can see by the above-mentioned command I have installed the vlc package. While installing packages, you can use this command.

Example 2: How to Update Packages with apt

To update an apt package in Ubuntu copy this command:

sudo apt update
EXPLANATION
  • update: Command to make packages up to date.

Update all the packages in the repository with aptIf you want to make all the available packages up to date, we can use the update option.

Example 3: How to Install a Package with apt-get

To install an apt-get package in Ubuntu copy this command:

sudo apt-get install vlc
EXPLANATION
  • apt-get: Provides a front-end command line interface for the package system.

Installing vlc package with apt-getIf you want to install different packages with apt-get, you can use this command.

Example 4: How to Update Packages with apt-get

To update an apt-get package in Ubuntu copy this command:

sudo apt-get update
EXPLANATION
  • update: Command to make packages up to date.

Updating all the packages with apt-getIf you want to update the available packages with apt-get, you can use this command. Here, it does not show the number of packages that need to be upgraded.

New Apt Commands

Apt comes with some new command which is not found in apt-get. And the new commands are apt list and apt edit sources.

New command Functions
apt list Shows the list of install and upgrade packages
apt edit sources Edit source list

From the table, you can see the new commands.

Conclusion

From the above discussion, you can understand that the apt package management tool is more user-friendly than apt-get and for that reason, the percentage of users increases day by day. Besides all these facilities, some users still prefer apt-get for their flexibility and detailed control over packages.

People Also Ask

Can I use apt-get instead of apt?
Yes, you can use apt-get instead of apt because the functions are similar for both of the commands. If you want to update a package then you can use both the commands ‘sudo apt update’ and ‘sudo apt-get update’ interchangeably.
Are apt-get and apt the same command?
 Yes, they are quite the same, and the result of the commands are pretty much the same. But if you are using an older version of Debian then apt will not work. In this case, you have to use the apt-get command.
What is the difference between apt install and apt-get install?
There is no difference between apt and apt-get install except for apt shows the progress bar from which you will know the time by which the installation might be completed.

Related Articles


<< Go Back to Linux Package Manager Comparison | Package Management in Linux | Learn Linux Basics

Rate this post
Afia Zahin Oishi

Assalamualaikum, I am Afia Zahin, completed my graduation in Biomedical Engineering from Bangladesh University of Engineering and Technology, currently working as a Linux Content Developer Executive at SOFTEKO. A high achieving professional with a strong work ethic and able to work in a team in order to consistently achieve my goal and build my skillset. Able to handle difficult problems with patience and swift decision-making. Read Full Bio

Leave a Comment