Published by: admin, date of publication: December 11, 2020

In order for the system to be as safe as possible, it must be regularly updated. Software cannot be perfect and new security problems, vulnerabilities and ways of circumventing defenses are constantly found in it. Developers are quick to release fixes for their systems. But for these fixes to apply, you need to upgrade.

Manual upgrade of CentOS 7.7

Updating CentOS 7 is a little easier than upgrading from Debian-like systems like Ubuntu. Here you just need to type one command, and the package manager itself will update the lists of repositories and form a list of packages that need to be updated. First, we look at the current version of your system:

cat /etc/redhat-release

On production servers, it is recommended to perform a full system backup before upgrading so that in case of an unforeseen situation, you can quickly restore everything. Make a backup copy of the / etc, / var, / opt directories. For systems running in virtual environments, it is desirable to take a snapshot. Then run the following command to update:

yum update

 Next, you need to confirm the update, for this, read the list of packages and press “y”:

The yum utility has a -y option to indicate that you automatically agree to the change, but it is not recommended. After completing the update, you need to restart the server:


Now you can view the version again:

cat /etc/redhat-release

CentOS Linux 7.7 automatic upgrade

Various control panels can update the system, but if the panels are not installed, the system has its own tool for automatic updates. You can even choose which updates you want to install, such as security only, new features, software updates, or nothing at all.

In order for everything to work, we need to install an additional package – yum-cron. To do this, type the following command:

yum install yum-cron

Snimok ekrana ot 2017 09 30 11 30 15 1024x576

Next, we need to configure it using the /etc/yum/yum-cron.conf configuration file:

The first option we need to configure is update_cmd – the command that will be used to update. Several options are available:

  • default – full update;
  • security – only security update;
  • security-severity: Critical – only critical security updates;
  • minimal – minimal update with bug fixes;
  • minimal-security – bug fixes and security updates;
  • minimal-security-severity: Critical – Bug fixes and critical updates.

For my example, I will use a full update. Let’s consider other settings:

  • update_messages – display messages about available updates;
  • download_updates – download updates automatically;
  • apply_updates – install updates automatically;

In the emitters section, you can configure possible ways to send messages about an available update, for example, to stdout or by email.

The emit_via option specifies how messages should be sent. The default is stdout, but you can replace this parameter with email. Next, you need to configure the email parameters in the email section:

  • email_from – sender;
  • email_to – where to send;
  • email_host is the name of the host on which the mail server is running.

To complete the configuration, you need to start the CentOS 7 automatic update service:

 systemctl start yum-cron

Also add it to startup:

systemctl enable yum-cron

 The CentOS 7 system will now update automatically.

Snimok ekrana ot 2017 09 30 12 31 25 1024x576

Other materials from our site:

Leave a Reply

Your email address will not be published. Required fields are marked *