Apt and Apt-get are two software package management tools for Ubuntu and Debian based Linux distros. They are used to update packages, install software, skins, remove and manage dependencies. Although they have similar functions, there are still some differences in features and usage syntax. If you read through ItsmeIT article, you will better understand the difference between Apt vs Apt-get command in Ubuntu / Linux.
Apt, introduced in Ubuntu 16.04, is a newer, faster and easier to use update and package management tool than Apt-get. Apt is designed to replace Apt-get in the future, but Apt-get is still retained to support users using old commands. Here ItsmeIT gives a few specific examples and will explain clearly, let’s see what is the difference between Apt and Apt-get.
Apt vs Apt-get: Repository Update
The apt-get update
command is one of the most popular and commonly used commands on Ubuntu and Debian systems. It allows reading the list of repositories and updating them, but does not provide any additional information about these repositories.
In contrast, the apt update command provides additional information about the repositories and software packages, such as the number of packages available for the update. For example, ItsmeIT tested and found that when using the apt-get update command, the system only updates the repositories list, while the apt update command provides information about the total number of software packages available for the build. update.
As you can see in the screenshot, Apt wins because it shows more detailed information when running apt-get command on terminal .
Apt and Apt-get in Linux what is the difference?
Apt vs apt-get in Ubuntu or Debian Linux are not the same. On Linux operating systems in general, there are various package management tools that support advanced packaging and collectively known as APT. Among them, apt-get command is one of the commands that can work with APT. Compared to apt-get, the apt command gathers all the necessary tools in one place, making package management simpler and more efficient.
Which command should be used between Apt or Apt-get
In most cases, the apt command will replace the apt-get command, so the question running around in your head might be, is the apt-get command discontinued?
The answer is no, the apt-get command is not discontinued. Because there are still some specific packages and tools that only work with apt-get command. These low-level functions will work, and commands that don’t require compilation will use the apt-get command. However, in most cases, the apt command is a better alternative to the apt-get command.
Examples of use cases for Apt-get vs Apt
To further illustrate the use cases of apt and apt-get commands, here are some specific examples:
Update packages on the system:
- Using apt:
sudo apt update
- Using apt-get:
sudo apt-get update
Both Apt and Apt-get commands in Ubuntu have the function to update the list of the latest packages on the system. But the way to connect to the server and pull data from the repository is different.
Install a package on the system:
- Using apt:
sudo apt install <package_name>
- Using apt-get:
sudo apt-get install <package_name>
Both commands have the function to install the named package <package_name>
on the system.
Remove a package on the system:
- Using apt:
sudo apt remove <package_name>
- Using apt-get:
sudo apt-get remove <package_name>
Both commands have the function to remove the named package <package_name>
from the system.
Install a package from a “.deb” file:
Note that in this case apt-get must be used to install package dependencies if any.
- Using apt:
sudo apt install ./<package_name>.deb
- Using apt-get:
sudo dpkg -i <package_name>.deb && sudo apt-get install -f
In short: Both Apt vs Apt-get command can be used to perform similar tasks on Linux system. However, there are still some cases where it is necessary or a command may work better for specific tasks. In addition, the apt command has the ability to install packages on the system with Debian package manager daemon functions, so that in some cases apt can also handle the dpkg -i command.
Ultimately the purpose of this article is not to give a good answer about the difference between Apt and Apt-get on Linux like Ubuntu 20.04, 22.04 or Debian. Instead, ItsmeIT has provided some examples and detailed explanations of these two statements. If you are new to Linux, I recommend you to try using the apt command because it is simpler and not complicated.
– Advertising –
Great article, I learned a lot of new things