Complete steps to set up automatic updates in CentOS 8

Complete steps to set up automatic updates in CentOS 8

The best thing you can do for your data and computers is to keep them safe. It’s as simple as turning on updates, however, most people using CentOS 8 don’t know how to do it.


Setup-CentOS-8-Automatic-Updates

In this article, you will learn how to enable automatic software updates on CentOS 8 Linux machine. You'll learn how to set up your system so that you don't have to manually install security and other updates.

1. Setting up automatic CentOS 8 updates using automatic RPM packages

The first thing to do is to install the DNF automatic RPM package. This package provides the DNF components that are automatically started. To install it, use the following command.

# dnf install dnf-automatic 

Install dnf-automatic in CentOS 8

You can use the rpm command to get more detailed information about the package.

# rpm -qi dnf-automatic 

Get information about dnf-automatic

The next step is to configure dnf auto-update. The configuration file is located in /etc/dnf/automatic.conf. After opening the file, you can set the required values ​​to suit the software requirements.

The configuration file looks like this:

[commands]
upgrade_type = default
random_sleep = 0
download_updates = yes
apply_updates = yes
[emitters]
emit_via = motd
[email]
email_from = [email protected]
email_to = root
email_host = localhost
[base]
debuglevel = 1

You can set dnf-automatic to just download new updates and alert you via email, but that means you will have to install the updates manually. To enable this feature, disable apply_updates in your configuration file.

apply_updates = no

Continue with setting up the alert method.

Finally, you can now run dnf-automatic. Execute the following command to schedule automatic DNF updates for your CentOS 8 machine.

# systemctl enable --now dnf-automatic.timer 

Scheduling DNF Automatic Updates on CentOS 8

The above command enables and starts the system timer. To check the status of dnf auto service, run the following command.

# systemctl list-timers *dnf-*

2. Setup Automatic CentOS 8 Updates using Cockpit Web Console

Cockpit comes pre-installed on CentOS 8, which allows system administrators to manage tasks from a web-based console. You can use Cockpit to update the operating system and software.

If Cockpit is not installed, you can install it with the following command:

# systemctl start cockpit.socket
# systemctl enable --now cockpit.socket
# systemctl status cockpit.socket 

Launch and Verify Cockpit Web Console in CentOS 8

Enable the firewall rules and access the following address:

# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

Locally: https://localhost:9090 

Open the Cockpit Web Console Port on the Firewall

To do this, log in to Cockpit using an administrator account at https://SERVER_IP:9090 (where SERVER_IP is the IP address of your CentOS 8 server). After logging in, click Software Update in the left navigation bar.


Software Updates for Cockpit-CentOS0-8

In the next window, turn Automatic Updates ON. You can now select the type of update you want (Apply all updates or Apply security updates), the date and time you want the updates to be applied, and reboot the server.


Cockpit - Setting up Automatic CentOS 8 Updates

Please note that you must restart your system to set up automatic updates. Therefore, make sure that you can reboot the server after selecting the update.

Summarize

In this article, you have learned how to set up automatic updates for your CentOS 8 machine. There are two ways to do this. The first method is to use DNF automatic update. The main advantage of enabling DNF auto-updates on CentOS 8 Linux is that your computer will be updated faster, more uniformly, and more frequently than if you updated manually.

This allows you to better respond to cyber attacks. The second method is to use the Cockpit web console. With Cockpit, enabling auto-updates is easy since DNF auto-update uses a graphical user interface (GUI) instead of the command line interface (CLI).

PS: This article is translated and the content has been modified and is not a translation of the original text.

Original link: https://www.tecmint.com/setup-automatic-updates-for-centos-8

Well, that’s all for this article. I hope the content of this article will be of certain reference value to your study or work. Thank you for your support of 123WORDPRESS.COM.

You may also be interested in:
  • Solutions to Multilib version problems when updating CentOS 7

<<:  MySQL: Data Integrity

>>:  js converts a multidimensional array into a one-dimensional array and then reorders it

Recommend

Centos7 installation of MySQL8 tutorial

MySQL 8 new features: My personal opinion on MySQ...

Prevent HTML and JSP pages from being cached and re-fetched from the web server

After the user logs out, if the back button on the...

Introduction to /etc/my.cnf parameters in MySQL 5.7

Below are some common parameters of /etc/my.cnf o...

CSS3 flip card number sample code

I received a task from the company today, and the...

Installation and configuration of mysql 8.0.15 under Centos7

This article shares with you the installation and...

A comprehensive analysis of what Nginx can do

Preface This article only focuses on what Nginx c...

Div css naming standards css class naming rules (in line with SEO standards)

There are many tasks to be done in search engine o...

HTML validate HTML validation

HTML validate refers to HTML validation. It is the...

Introduction to Computed Properties in Vue

Table of contents 1. What is a calculated propert...

SQL ROW_NUMBER() and OVER() method case study

Syntax format: row_number() over(partition by gro...

How to use React forwardRef and what to note

Previously, react.forwardRef could not be applied...

Is a design that complies with design specifications a good design?

In the past few years of my career, I have writte...

RGB color table collection

RGB color table color English name RGB 16 colors ...