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

Vue element implements table adding, deleting and modifying data

This article shares the specific code of vue elem...

Docker realizes the connection with the same IP network segment

Recently, I solved the problem of Docker and the ...

Detailed explanation of the syntax and process of executing MySQL transactions

Abstract: MySQL provides a variety of storage eng...

MySQL 8.0.11 Installation Guide for Mac

MAC installs mysql8.0, the specific contents are ...

VSCode+CMake+Clang+GCC environment construction tutorial under win10

I plan to use C/C++ to implement basic data struc...

In-depth explanation of the impact of NULL on indexes in MySQL

Preface I have read many blogs and heard many peo...

Using react-virtualized to implement a long list of images with dynamic height

Table of contents Problems encountered during dev...

HTML multi-header table code

1. Multi-header table code Copy code The code is a...

Sample code for implementing mysql master-slave replication in docker

Table of contents 1. Overview 1. Principle 2. Imp...

How CSS affects the white screen time during initial loading

Rendering pipeline with external css files In the...

Vue uses ECharts to implement line charts and pie charts

When developing a backend management project, it ...

JavaScript built-in date and time formatting time example code

1. Basic knowledge (methods of date objects) 😜 ge...

Detailed explanation of Linux mpstat command usage

1. mpstat command 1.1 Command Format mpstat [ -A ...