Updating and Upgrading the Ubuntu/CentOS server

In this chapter, you will learn

  1. What is difference between Update and Upgrade?
  2. How to Update and Upgrade the Ubuntu server?
  3. How to Update and Upgrade the CentOS server?

apt (Advanced Packaging Tool) and yum in Linux


apt (Advanced Packaging Tool) and Yum are excellent features in Linux that enable you to carry out various packaging-related tasks, such as installing packages, updating packages, upgrading packages, and more.

After logging into a VPS server or Linux machine, it is essential to check the current version of installed applications using the apt-get command (for Ubuntu/Debian) or yum command (for CentOS).


Difference between update and upgrade

The apt-get update (Ubuntu) or yum (CentOS) command checks for the latest version information for installed applications and updates that information. On the other hand, the apt-get upgrade (Ubuntu) or yum (CentOS) command searches for newer/latest versions of installed applications and installs them.

The upgrade command verifies the application information updated by the update command and carries out the necessary actions.

It is imperative to run the update command before the upgrade command.


How to Update and Upgrade the Ubuntu/CentOS server?

For Ubuntu server: To perform the update and upgrade command in Ubuntu server, execute the following command in sequence.

sudo apt-get update
$sudo apt-get upgrade

For CentOS server: To perform the update and upgrade command in CentOS server, execute the following command in sequence.

sudo yum update
$sudo yum upgrade

Summary

In this chapter, you learned how to perform the update and upgrade commands in Ubuntu and CentOS servers. In the next chapter, you will learn how to view some server specifications.