Ubuntu

What does the apt update do on Ubuntu and Debian

Let’s start with Ubuntu and Debian, as we know that Linux has many distributions, and Ubuntu and Debian are two of them. Debian and Ubuntu work on the packaging systems. These packages include Hardware, Linux kernel, and software packages. These all packages are placed on an online server, which is called software repositories. Using the most popular apt command-line tool, users can manage these packages from the enabled software repositories. This article will provide you with information about the ‘apt update’ command, and we will talk about what it does on Ubuntu and Debian distributions. Therefore, we will explore the apt command.

What is APT?

The apt is a powerful command-line tool or package manager used on Ubuntu, Debian, and its derivative distros. APT is an Advanced packaging Tool that performs various tasks: new software packages installation, upgrades the existing installed packages, updates the packages index list, and you can also even upgrade the Ubuntu or Debian system using the apt command.

What is the apt update?

The apt update command is used to update the apt packages index. Apt packages index is a database that stores the list of software packages from the repository.

We can also say that the ‘apt update’ command browse the complete list of packages, copy their latest version, and place them in our system from software repositories.

$ sudo apt update

The above apt update command should run under the sudo privileges, or a root user can run this command on a Linux system. This command downloads the latest updated software meta-packages information (names, version, etc.). Therefore, the recommended way is that the ‘apt update’ should execute before an upgrade of the software package.

What does the apt update do on Ubuntu and Debian?

Apt update command collects the latest packages information from all configured sources defined in the ‘/etc/apt/sources.list’ file and the ‘/etc/apt/sources.list.d’ directory. When a user runs the apt update command on Ubuntu and Debian systems, it downloads the information about all packages for your repository and PPA’s from the internet. Then, make sure that all packages are up to date. Therefore, this command is useful to get the details about updated packages’ versions and their dependencies.

The apt update command is executed in Linux Debian and Ubuntu distributions after installing a new system or a software package. After implementing this command, the package index of Ubuntu and Debian systems gets an update. The apt update command only updates the list of packages, and no package is upgraded by it. This command can be executed without any fear of harm to the system. You can also resume this command in case the command is aborted or unplugged.

What indicates the Hit, Ign, and Get words in the apt update command?

Different three types of keywords lines show on the terminal window while you update the packages index. Below we have explained these three categories:

Hit: This represents there is no change occurred in the package version. It is the same as the previous version of a package.
Ign: This indicates the package is being ignored. The package is too recent; I did not bother to check this package, or maybe recently updated. Therefore, this trivial error can occur in retrieving file information. However, it does not count as an error.
Get: This represents a new version of a package that is available. Therefore, it downloads the details about only the package version, not the package itself. Users can view the metadata download details such as package size in kb that are also mentioned with the get line in the above screenshot.

Conclusion

Hence, we have seen how the sudo apt update command helps Ubuntu and Debian users to update the system packages. We also explained all components of the apt update command in detail in this article. Using the apt update command, you can retrieve the information from all configured sources listed in your system’s ‘/etc/apt/sources.list’ file. After reading the above details, I hope this article will provide deep information about the apt update command. Thanks!

About the author

Samreena Aslam

Samreena Aslam holds a master’s degree in Software Engineering. Currently, she's working as a Freelancer & Technical writer. She's a Linux enthusiast and has written various articles on Computer programming, different Linux flavors including Ubuntu, Debian, CentOS, and Mint.