mise à jour automatique centos 8
Linux

Configurer les mises à jour automatique pour CentOS 8

Les mises à jour automatique est l’un des meilleurs moyens pour protéger vos données et vos logiciels. Cela nous évite d’installer les mis à jours manuellement à chaque fois.

Nous allons voir dans ce guide comment activer les mises à jours automatique au niveau de CentOS 8.

Mises à jour automatique pour CentOS 8 avec DNF-automatic

Premièrement nous allons installer le package DNF-automatic, ce dernier permet a dnf de démarrer automatiquement, pour l’installer taper la commande ci-dessous :

[root@server ~]# dnf install dnf-automatic

Pour avoir plus d’infos sur ce package taper la commande ci-dessous :

[root@server ~]# rpm -qi dnf-automatic
Name : dnf-automatic
Version : 4.0.9.2
Release : 2.el7_9
Architecture: noarch
Install Date: Wed 15 Sep 2021 11:46:23 AM EDT
Group : Unspecified
Size : 52781
License : GPLv2+ and GPLv2 and GPL
Signature : RSA/SHA256, Fri 09 Apr 2021 10:23:16 AM EDT, Key ID 24c6a8a7f4a80eb5
Source RPM : dnf-4.0.9.2-2.el7_9.src.rpm
Build Date : Wed 07 Apr 2021 11:52:38 AM EDT
Build Host : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem http://bugs.centos.org
Vendor : CentOS
URL : https://github.com/rpm-software-management/dnf
Summary : Package manager - automated upgrades
Description :
Systemd units that can periodically download package upgrades and apply them.

Configuration de la mise à jour de dnf-automatic

Le fichier de configuration de dnf-automatic est /etc/dnf/automatic.conf :

[commands]
What kind of upgrade to perform:
default = all available upgrades
security = only the security upgrades
upgrade_type = default
random_sleep = 0
To just receive updates use dnf-automatic-notifyonly.timer
Whether updates should be downloaded when they are available, by
dnf-automatic.timer. notifyonly.timer, download.timer and
install.timer override this setting.
download_updates = yes
Whether updates should be applied when they are available, by
dnf-automatic.timer. notifyonly.timer, download.timer and
install.timer override this setting.
apply_updates = no
[emitters]
Name to use for this system in messages that are emitted. Default is the
hostname.
system_name = my-host

Editez ce fichier et mettez la valeur « no » pour apply_updates :

#Whether updates should be applied when they are available, by
#dnf-automatic.timer. notifyonly.timer, download.timer and
#install.timer override this setting.
apply_updates = no

Exécutez ensuite la commande suivante :

[root@mail ~]# systemctl enable --now dnf-automatic.timer
Created symlink from /etc/systemd/system/multi-user.target.wants/dnf-automatic.timer to /usr/lib/systemd/system/dnf-automatic.timer.

Pour vérifier la status de dns-automatic taper la commande ci-dessous :

[root@mail ~]# systemctl list-timers *dnf-*
NEXT                        LEFT       LAST  PASSED    UNIT                ACTIVATES
Wed 2021-09-15 12:40:06 EDT 36min left n/a   n/a       dnf-automatic.timer dnf-automatic.service
1 timers listed.
Pass --all to see loaded but inactive timers, too.

You might also like

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *