Most of us are often confused with the difference between apt and apt-get command.
This confusion prevails among all the users, including beginners and experienced.
These command line tools are much similar in use to manage package operations which includes Installation, upgrade, and removal.
In this article, we will discuss about the difference between apt and apt-get commands.
Make a note: Please do not confuse the ‘apt’ command with APT(Advanced Package Tool), both are not the same. Before discussing apt & apt-get command, let’s see, what is APT?
What is APT?
APT (Advanced Package Tool) is a collection of tools that manage Debian’s packaging system.
It works with core libraries such as “libapt-pkg” and “libapt-inst” to simplify the package management process in Debian, Ubuntu and their derivatives.
Command-line tools such as apt, apt-get, apt-cache, apt-config and aptitude (GUI) interact with the APT to perform different package functions such as Install, update and delete.
What is apt command?
apt is a command line utility for installing, updating, and removing deb packages on Ubuntu, Debian, and their derivatives. It combines the most commonly used commands from the apt-get and apt-cache.
apt command is suitable for end users and does not contain some of the additional features of apt-get command. apt was designed to fix some of the fundamental dependency flaws in apt-get.
What is apt-get command?
apt-get is a CLI package management tool that is widely used on Debian based systems. The apt-get command allows us to Install, update, and remove packages, while the apt-cache command is used to search for new packages.
apt-get can be considered as a low-level front-end tool for the APT package system with backward compatibility.
There is no official document says that apt-get is deprecated and can no longer be used hence use the apt-get based on your requirement.
What is wrong with the apt-get command?
Different set of apt-get commands are used to perform multiple operations which is supposed to exist in a package manager. We know, this is due to inefficiency and lack of functionalities with apt-get.
- apt-get – Users are limited to install, update and remove the package.
- apt-cache – Used to search a package.
- dpkg – Used to list all the packages installed on the system.
This is where the problem arises and the apt command combines all these functions into a single command to facilitate interaction with the APT package manager.
What is the difference between apt and apt-get?
Main difference between apt and apt-get as follows:
- apt comes with fancy progress bar
- apt shows a list of packages that need to be upgraded
- apt combines the function of apt-get, apt-cache and dpkg -l
- Syntax comparison of apt and apt-get command
- apt new commands
1) apt comes with fancy progress bar
Progress bar will be visible when it is installing or removing a package with the apt command. This simple progress bar shows the progress percentile of the current process.
2) apt shows a list of packages that needs to be upgraded
Below output shows the number of packages that can be upgraded while updating the repository database.
List of packages and other information can be viewed by running the command
apt list --upgradable, as mentioned below
3) apt combines the function of apt-get, apt-cache and dpkg -l
Prior to Ubuntu 16.04, users usually interacted with the APT package manager for package operation via apt-get and apt-cache. It comes with a lot of functionalities and users are forced to remember all of them, which will eventually make the end users to suffer.
After that release, the apt command grabbed attention from users, rather than the traditional apt-get command.
This is because the apt command integrates the functions of apt-get & apt-cache along with essential commands in a well organized manner.
This makes the apt command to provide an efficient way of handling the packages.
4) Syntax comparison of apt and apt-get command
apt command combines commonly used apt-get and apt-cache functions, but they are not backward compatible with apt-get. Therefore, you can not always replace the apt-get command with apt.
|apt command||apt-get command||Function|
|apt update||apt-get update||Refreshes repository index|
|apt install [package]||apt-get install [package]||Install a package|
|apt upgrade||apt-get upgrade||Upgrade available package updates|
|apt remove [package]||apt-get remove[package]||Remove a package|
|apt purge [package]||apt-get purge [package]||Remove a package with configuration|
|apt autoremove||apt-get autoremove||Remove unnecessary dependencies|
|apt full-upgrade||apt-get dist-upgrade||Update all packages and remove unnecessary dependencies|
|apt search [package]||apt-cache search [package]||Search for a package|
|apt show [package]||apt-cache show [package]||Show package details|
|apt policy||apt-cache policy||Show active repo information|
|apt policy [package||apt-cache policy [package]||Show installed and available package version|
5) apt new commands
apt has some commands of its own which gives some extra functionality.
|New apt command||Function|
|apt list||List installed packages and upgradable packages|
|apt edit-sources||Edits sources list|
This article provides us the main difference between apt and apt-get command in brief.