×


How does sudo apt-get update work in Ubuntu / Debian Linux system ?

In different Linux distributions, the recommended method is to update the packages before installing a new application on your system. We mostly used the 'sudo apt-get update command' before and after installing a new package for updating system packages list. Most of the users use this command but most of them do not know the exact purpose or do not have knowledge of how it works in Linux.

Here at Ibmi Media, we shall look into the 'sudo apt-get update' command and how does it work in Linux distribution.

You can also set up automatic unattended updates in Ubuntu Linux system here https://linuxapt.com/blog/configure-automatic-unattended-updates-in-ubuntu-2004


What does sudo apt-get update command do?

The apt-get update is a well-known package management command in Linux system. In recent Linux distributions, the 'apt update' command is used.  The 'apt-get' manages the packages such as install, update or remove. The repository contains the packages files and metadata information. The "sudo apt-get update" or "sudo apt update" command downloads the updates of all packages repositories from all configured files or sources:

$ sudo apt update
$ sudo apt-get update

The 'apt-get update or apt update' command must run under the superuser 'sudo' or a root user privileges otherwise, you will get an error on the terminal window. 

So, the 'sudo apt-get update' command is used in older versions of Linux distributions. The standard user without root privileges cannot run this command.  When we run the 'sudo apt-get update' command, it downloads the new packages updates from the internet.

Using this command, you can easily collect the updated version details of installed packages or dependencies.


[Need help in fixing Linux System issues ? We can help you. ]


Conclusion

This article covers the sudo apt-get update command which is useful for all beginners and Linux users. In fact, To explore more about this command, run the apt-get update or apt update command on your Linux system. 


What does sudo apt-get upgrade command do?

  • The sudo apt-get update command is used to download package information from all configured sources.
  • The sources often defined in /etc/apt/sources.list file and other files located in /etc/apt/sources.list.d/ directory.
  • So when you run update command, it downloads the package information from the Internet. It is useful to get info on an updated version of packages or their dependencies.


How to Run sudo apt-get update command to update package index ?

Simply type apt-get command or apt command:

$ sudo apt update

OR

$ sudo apt-get update