logo icon groot

How to update CentOS 7

Do you manage a CentOS 7 server yourself? Then it’s important to ensure that all software and security updates are performed at all times. Having your software and security up-to-date ensures that you’re not susceptible to a hack/vulnerability.

When performing updates on your server, it’s always important to have a backup that’s stored externally (so not on your server itself). This is important in case your server has any error or crashes. When this happens, it won’t be possible to access your backup. By saving your backup externally, you can prevent a lot of problems.

To update CentOS 7 on your server you need to have SSH access. To get this, you can use Putty on Windows or the terminal on Mac and Linux.

Step 1: Check if you’re using CentOS 7 

Before we start with updating CentOS 7, we have to check if you’re indeed running CentOS on your server. To see if this is the case, we have to run the following command:

cat /etc/redhat-release

If you’re indeed running CentOS 7, you should get the following result:

CentOS Linux release 7.8.2003 (Core)

If you got this result, we know that you’re running the correct CentOS version and we can continue with step 2.

Step 2: Clear cache

Before we start with the actual update of CentOS 7, we have to ensure that all caches are emptied and that it has the most recent repos (software servers and lists). We can do this with the following command:

yum clean all -y

When this has been done successfully, we can continue with the update.

Step 3: Update CentOS 7

Do you want to use the recommended settings for the update? Then you can run the following command: 

yum update -y

If you want to decide which settings are used in the update yourself, you can omit -y. This command will look as follows:

yum update

After you’ve updated CentOS 7, it’s important to perform a server reboot. By performing a server reboot you can confirm that everything is done successfully. 

reboot

If you have any questions or need help, you can always contact our support team click here

Also check out our other posts on topics such as “the best ways to secure your server”, “how to create an external backup server” and a lot more! Click here

Share this with someone who'd like to read this

Recent Posts

How to update DirectAdmin

Updating DirectAdmin is necessary to ensure that your system has the most recent security updates. If you have an unmanaged VPS or dedicated server, you will probably

Read More

How to update AlmaLinux

Like any other distribution, it’s important to update your AlmaLinux system. By keeping your AlmaLinux system up to date, you will be sure to have the latest

Read More