Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set automatic updates for CentOS 8

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to set up automatic updates in CentOS 8. I hope you will get something after reading this article. Let's discuss it together.

The best thing you can do for data and computers is to make sure they are safe. It's as simple as opening an 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 your system so that you do not have to install security and other updates manually.

1. Use the automatic RPM package to set up automatic CentOS 8 updates

The first step is to install the DNF automatic RPM package. This package provides DNF components that start automatically. 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 details about the package.

# rpm-qi dnf-automatic

Get information about dnf-automatic

The next step is to configure dnf automatic updates. The configuration file is located in / etc/dnf/automatic.conf. After opening the file, you can set the desired value to suit the software requirements.

The configuration file is as follows:

[commands] upgrade_type = defaultrandom_sleep = 0download_updates = yesapply_updates = YES [emitters] emit_via = motd [email] email_from = root@myserver.example.comemail_to = rootemail_host = localhost [base] debuglevel = 1

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

Apply_updates = no

Continue to set the alarm 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 the dnf automatic service, run the following command.

# systemctl list-timers * dnf-*

two。 To set up automatic CentOS 8 updates using the Cockpit Web console

Cockpit is pre-installed on CentOS 8, which enables system administrators to manage tasks from the Web-based console. You can use Cockpit to update the operating system and software.

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

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

Start and verify the Cockpit Web console in CentOS 8

Activate firewall rules and visit the following address:

# firewall-cmd-add-service=cockpit-permanent# firewall-cmd-reloadLocally: https://localhost:9090

Open the Cockpit Web console port on the firewall

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

Software updates of Cockpit-CentOS0-8

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

Cockpit- Settings automatic CentOS 8 updates

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

Summary

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 DNF automatic updates on CentOS 8 Linux is that your computer updates faster, more uniformly, and more frequently than manual updates.

This allows you to better deal with cyber attacks. The second method is to use the Cockpit Web console and Cockpit, which is easy to enable because you use the graphical user interface (GUI) instead of the command line interface (CLI) for DNF automatic updates.

After reading this article, I believe you have a certain understanding of "how to set up automatic updates in CentOS 8". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report