Debian

How to Update Debian

How_to_Update_Debian

It is best practice to update your system on a routine basis for maintaining security and stability. This post will help you keep your Debian system up to date. If you are looking to update your Debian Linux system, here we explained what you want to do.

Let me explain how to update a Debian system using apt update and apt upgrade commands.

The apt, or the older apt-get, is a Debian Linux package manager that runs from the command line. Using the apt command, you can install, uninstall, and manage software packages of your system. You can use just a single command to update all of your system’s software. This includes all Linux kernel updates issued by Debian.

What does the sudo apt update command do?

This command may appear to update the system; however, this is not the case.

The apt package manager uses the local database of metadata (name, version, description, and repository information) about software packages. The apt update command updates the database of the local packages’ cache.

$ sudo apt update

When you execute the apt update command in the terminal. As a result, it updates the local cache or metadata from the Debian repository.

The ‘apt update’ command enables your system to check if a related new version of an installed package is available. You can see the packages, that need to be upgraded using:

$ sudo apt list –upgradable

What does the sudo apt upgrade do?

This is the command that keeps your Debian system up to date.

It is necessary to run the apt update command first. Therefore, your system should be aware of the new package version’s availability.

With this information, the apt upgrade command downloads and installs the latest versions of the packages from the Debian repositories. As a result, your Debian systems’ software components are all upgraded to the latest version.

Combine the above two commands: sudo apt update && sudo apt upgrade -y

One way to run many Linux commands at once is to use the ‘&&’ operator.

$ sudo apt update && sudo apt upgrade –y

After the first command completes successfully, the second command, apt upgrade -y, is executed automatically.

After the first command completes successfully, the second command, apt upgrade -y, is executed automatically.

The -y option is being used with the apt upgrade command. Because the apt upgrade requires your approval before it can download and update the system. Because of the -y, you can save some time by answering ‘yes’.

Conclusion

The apt update and apt upgrade commands eliminate the requirement for manual intervention during Debian updates. Even if it is a mixture of several commands, everything is done in a single command. I hope you all find this Debian brief beginner’s guide useful.

Similar Posts