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

Native JS to implement hover drop-down menu

JS implements a hover drop-down menu. This is a s...

Three ways to prevent MySQL from inserting duplicate data

Create a new table CREATE TABLE `person` ( `id` i...

Native JS to achieve draggable login box

This article shares a draggable login box impleme...

Some common mistakes with MySQL null

According to null-values, the value of null in My...

How to use docker compose to build fastDFS file server

The previous article introduced a detailed exampl...

Summary of 6 solutions for implementing singleton mode in JS

Preface Today, I was reviewing the creational pat...

Floating menu, can achieve up and down scrolling effect

The code can be further streamlined, but due to t...

What is MIME TYPE? MIME-Types type collection

What is MIME TYPE? 1. First, we need to understand...

Detailed explanation of putting common nginx commands into shell scripts

1. Create a folder to store nginx shell scripts /...

MySQL database aggregate query and union query operations

Table of contents 1. Insert the queried results 2...

7 skills that great graphic designers need to master

1》Be good at web design 2》Know how to design web p...

jQuery to achieve the barrage effect case

This article shares the specific code of jQuery t...

How to enter directory/folder in Linux without using CD command

As we all know, without the cd command, we cannot...