How to update Linux Server | CentOS
As a system administrator, one of our responsibilities is to run server updates. However, if these updates are not installed carefully, they might break the programs or applications running on the system.
The applications break due to multiple reasons, such as, compatibility issues with new updates or if the software dependencies break due to new updates.
So, we should monitor updates carefully!
Note: If you run into an error message that says: Error: rpmdb open failed. You can follow the instructions in this article.
In order to update your CentOS server manually, you can follow these steps:
- Update the repositories by running this command:
# sudo yum update
- Once the update is completed successfully, verify the messages on the screen. It should appear similar to what is shown in the image below:
- You can verify that all the updates are installed by running the following command:
# sudo yum upgrade
- If any updates are pending, they will be installed. Otherwise, you will see a message ‘no packages marked for update’.
- Now, you can schedule a reboot for your system so that all the updates are applied successfully. Run this command:
# shutdown -r 00:00
Then -r syntax reboots the system. So, according to the above mentioned command, the system will reboot at 12:00 am midnight.
If you run into an error message that says: Error: rpmdb open failed. You can follow the instructions in this article.