aoitcloud

CentOS 7

How to Update CentOS 7

CentOS 7 is one of the most popular Linux distribution used in a large amount of web servers around the world. It is critical you keep your system up-to-date and ensure that you have the latest security patches and updates to reduce the vulnerabilities. In this tutorial, we will show you how to update CentOS

1 February 2023 2 min read

Update: CentOS 7 reached end of life on 30 June 2024 and no longer receives updates, including security patches. The steps below are kept for reference only. If you are running a VPS, see How to Update AlmaLinux and Rocky Linux, the distributions that replaced it.

CentOS 7 was one of the most widely used Linux distributions on web servers worldwide during its supported lifetime. While it was still receiving updates, keeping it patched with the latest security fixes was critical to reducing vulnerabilities – the steps below reflect that process, and are kept here purely as a historical reference now that CentOS 7 is end of life.

Before running any update, it’s a good idea to make a backup of your system in case something goes wrong during the process.

  1. First, check which version of CentOS you’re running:
cat /etc/centos-release
  1. Next, refresh the package manager’s package list:
yum update

This may take some time, depending on the number of packages that need updating.

  1. Once the package list has refreshed, upgrade your system:
yum upgrade

This upgrades all packages on your system to their latest available version.

  1. If you want to update just a single package, use:
yum update <package_name>

Replace <package_name> with the name of the package you want to update.

  1. After the upgrade completes, reboot your system to apply the changes:
reboot
  1. After the system has rebooted, confirm the update was successful:
cat /etc/centos-release

This will display the version of CentOS you’re now running.

Get in touch

Drop our team a message today