+3 votes
419 views
Automatically install security updates on CentOS 8

in Linux / Unix by (551k points)
reopened | 419 views

1 Answer

+4 votes
Best answer

1. How to install dnf-automatic CentOS 8
2. Configuration of dnf-automatic in CentOS 8
3. Start and enable dnf-automatic in CentOS 8
4. How to install security updates on CentOS 8 using Cockpit

The updates of the operating system are a critical point in any environment because updates allow the operating system and its applications and processes are always in constant integrity because many of the updates contain security enhancements and compatibility..

 

Security updates play a more than essential role in Linux environments offering the administrator full control of what is expected at the performance level, and although the updates can be validated and applied manually, the automatic method is much more secure since we can manually forget it by exposing the equipment to security flaws and accidental attacks.

 

 

In this aspect of automatic updates comes into play dnf-automatic which has been developed in order to run automatically and regularly through system timers, cron jobs avoiding constant interaction by the system administrator ..

 

The dnf-automatic service will only accept an optional argument which is routed to the configuration file, as well as some control arguments that are used by the services that function as a backup of the CentOS 8 timer units in this case. In case of not using any configuration file, /etc/dnf/automatic.conf will be used.

 

This process works by first synchronizing the package metadata and then proceeding with the search for the updates available for CentOS 8. The process of downloading the packages or downloading and applying the packages follows. This will depend on the configuration set by the administrator..

 

dnf-automatic plays with other processes like:

 dnf-automatic-notifyonly dnf-automatic-download dnf-automatic-  install  
TechnoWikis will teach you how to install and configure dnf-automatic on CentOS 8 to centrally manage system updates.

 

 


1. How to install dnf-automatic CentOS 8

 

Step 1

The first step to take will be to install the respective package by executing the following:
 sudo dnf  install  dnf-  automatic  
image

 

Step 2

We enter the letter "s" to confirm the download and installation of the associated packages, when this ends we will see the following:

 

image

 

Step 3

After this step we will check that everything has been installed correctly by executing the following command rpm
 rpm -qi dnf-automatic 

There we find the respective details of dnf-automatic like:

  • name of process
  • installed version
  • type of architecture
  • size
  • route and much more

 

 

image

 

 

 


2. Configuration of dnf-automatic in CentOS 8


After verifying that everything is correctly installed it is time to configure the service, the default dnf-automatic RPM configuration file is the automatic.conf file.

 

Step 1

This is hosted in the path / etc / dnf /, we access it using a text editor:
 sudo nano /etc/dnf/automatic.conf 
Step 2

We will see the following:

 

 

 

 

image

 

Step 3

In the section "commands" we must define the type of update that we will use in CentOS 8, if we leave the default values ​​it will apply to all available updates, as the point is only security updates we will define the following:
  upgrade_type  = security 
image

 

Step 4

We replace "default" with "security", now we go to the "emitters" section and there we establish the following:
  system_name  = centos-  8  
image

 

We have replaced "my-host" with "centos-8".

 

Step 5

Finally, in the field "emit_via" we set "motd" instead of "stdio":

 

image

 

We save the changes with the Ctrl + O keys and exit the editor with the Ctrl + X keys.

 


3. Start and enable dnf-automatic in CentOS 8

 

Step 1

After this the next step to take is to start and enable the dnf-automatic service in CentOS 8, for this we execute the following:
 systemctl  enable  --now dnf-automatic.timer 
image

 

Step 2

We check the status of the dnf-automatic service by running:
 systemctl  list  -timers * dnf- * 
image

 

Step 3

We see this because we have not created any timer tasks for dnf, in case of assigning a time we will see the following:

 

image

 


4. How to install security updates on CentOS 8 using Cockpit


Cockpit is a web console that has been developed to facilitate all CentOS 8 administration tasks in a graphical way, to know how to install it we invite you to visit the following tutorial:

 

https: //www.solvetic...le-en-centos-8/

 

Step 1

Once enabled we access with the following syntax:
 http:  // IP_CentOS: 9090  
image

 

Step 2

We enter the user credentials and in the console we will go to the "Software Updates" section where we will see the following:

 

image

 

Step 3

We will activate the switch "Automatic updates" and in the drop-down field we select "Apply security updates":

 

image

 

We can define on the side both the frequency (each day or a specific day) as well as the time at which security updates will be searched, downloaded and installed in CentOS 8.
Thus we can configure the updates in CentOS 8 thanks to dnf- automatic and we can carry out this process either from the console or graphically depending on the most ideal method for each of us.

 


by (3.5m points)

Related questions

+5 votes
1 answer
asked Aug 10, 2020 in Linux / Unix by backtothefuture (551k points) | 232 views
+4 votes
1 answer
asked Oct 8, 2020 in Linux / Unix by backtothefuture (551k points) | 344 views
+5 votes
1 answer
asked Sep 2, 2020 in Linux / Unix by backtothefuture (551k points) | 2k views
+3 votes
1 answer
asked Aug 13, 2020 in Linux / Unix by backtothefuture (551k points) | 1.9k views
+4 votes
1 answer
asked Jun 9, 2020 in Linux / Unix by backtothefuture (551k points) | 601 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,634 questions
10,766 answers
510 comments
3 users