CentOS 8 complete steps to set up automatic updates

The best thing you can do for data and computers is to keep them safe. It's as simple as turning on the update, but most people who use CentOS 8 don't know what to do.

Setup-CentOS-8-Automatic-Updates

In this article, you will learn how to enable automatic software updates on CentOS 8 Linux machines. You will learn how to set up the system so that there is no need to manually install security and other updates.

1. Set up automatic CentOS 8 updates with automatic RPM packages

The first is to install the DNF automatic RPM package. The software package provides automatic startup DNF components. 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 to update automatically. 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 is as follows:

[ 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 only download new updates and alert you via email, but this means you will have to install updates manually. To enable this feature, please disable apply_updates in the configuration file.

apply_updates = no

Continue to set the alert method.

Finally, you can now run dnf-automatic and execute the following command to schedule automatic DNF updates for CentOS 8 computers.

# systemctl enable --now dnf-automatic.timer

Schedule automatic DNF updates on CentOS 8

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

# systemctl list-timers *dnf-*

2. Use the Cockpit web console to set up automatic CentOS 8 updates

Cockpit is pre-installed on CentOS 8, which enables 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 the Cockpit web console in CentOS 8

Open firewall rules and visit the following addresses:

# 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, please log in to Cockpit at https://SERVER_IP:9090 (where SERVER_IP is the IP address of the CentOS 8 server) using an administrator account. After logging in, click Software Update in the left navigation bar.

Cockpit-CentOS0-8 software update

In the next window, turn on automatic update ON. Now you can select the type of update you want ("Apply all updates" or "Apply security updates"), the date and time you want to apply the update, and reboot the server.

Cockpit-set up automatic CentOS 8 updates

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

to sum up

In this article, you learned how to set up automatic updates for CentOS 8 computers. There are two ways to do this. The first method is to use DNF to update automatically. The main advantage of enabling automatic DNF updates on CentOS 8 Linux is that your computer updates faster, more uniformly, and more frequently than manual updates.

This allows you to better respond to cyber attacks. The second method is to use the Cockpit Web console. Using Cockpit, it is easy to enable automatic updates due to the DNF automatic update using the graphical user interface (GUI) instead of the command line interface (CLI).

PS: This article is from a translation, the content in the article has been changed, not the original translation.

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

Well, the above is the entire content of this article. I hope that the content of this article has a certain reference value for your study or work. Thank you for your support to ZaLou.Cn.

Recommended Posts

CentOS 8 complete steps to set up automatic updates
Detailed steps to set up a Git server on CentOS
How to set up SSH keys on CentOS 8
Centos7 set up GitBook environment
Centos6 set up GitBook environment
centos6.9 rabbitmq set up SSL
How to set up an Apache virtual host on CentOS 7
How to upgrade CentOS7 to CentOS8 (detailed steps)
CentOS 7 set up NTP, SSH service
Centos6 method steps to build gitlab
CentOS 6.8 method steps to install vsftpd
How to set up the Nginx server configuration block on CentOS 8
How to set up Gogs on Ubuntu 14.04
How to set up R on Ubuntu 14.04
How to set up Shiny Server on Ubuntu 14.04
How to set up time synchronization on Ubuntu 18.04
Set up a CentOS network with Virtualbox on MacOS
How to set up Ghost one-click app for Ubuntu 16.04
Centos8 implementation steps to build a local web server
Complete steps to configure IP address in Ubuntu 18.04 LTS
Complete steps to realize face recognition login in Ubuntu
Detailed steps to install centos on vmware10.0 cracked version
Many attempts to set up soft routing in ubuntu