📅  最后修改于: 2023-12-03 15:32:40.473000             🧑  作者: Mango
As a programmer working with Linux operating system, keeping the system up-to-date is a crucial task. An outdated system not only leaves the system open to security vulnerabilities but may also cause software compatibility issues. In this tutorial, we will discuss how to update the Linux OS via shell-bash commands.
Before updating the system, we should update the package information of the OS. This is done via the following command:
sudo apt-get update
If the system is using yum
package manager, then the command would be:
sudo yum update
This command updates the package repos and downloads the latest software package details available on the repos.
Once the package information is updated, we can safely update the system. The following command does that.
sudo apt-get upgrade
For yum
,
sudo yum upgrade
This command updates the installed software packages to the latest version available in the package repositories. Sometimes, a major system update may require a reboot.
In some cases, the OS may require a distribution upgrade. We can check whether there is a new distribution version available via the following command:
sudo do-release-upgrade
For yum
, we can use:
sudo yum update-to
By running this command, the system will check for a new version of the OS, and if that is the case, then the system will prompt for confirmation to upgrade the distribution.
In this tutorial, we've learned how to update a Linux operating system via shell-bash commands. The updating process involves updating package information, updating the system, and checking for distribution upgrade. By keeping the system up-to-date, we can ensure system security and compatibility with new software.