・アップデートの実行

[root@centos]# dnf -y update
[root@centos]# dnf -y upgrade

CentOS のインストール直後はかなりのアップデート 項目がありかなり時間が掛かるがセキュリティー上重要なことなので必ずアップデートを実行


・dnf-automatic のインストール

1日1回(夜間)の自動アップデートを行う dnf-automatic をインストール

[root@centos]# dnf install -y dnf-automatic


・dnf-automatic の設定

[root@centos]# vi /etc/dnf/automatic.conf
[commands]
# What kind of upgrade to perform:
# default = all available upgrades
# security = only the security upgrades
upgrade_type = default※必要に応じて書き換え(default 全て : security セキュリティ関係)

# Maximum time in seconds to wait until the system is on-line and able to
# connect to remote repositories.
network_online_timeout = 60

# 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 = yes※必要に応じて書き換え(yes 自動更新 : no ダウンロードのみ)

≪ 以下省略 ≫


上記設定は更新の有無を確認して更新があれば自動的にダウンロード及びアップデートを行う


・nf-automatic の起動

[root@centos]# systemctl start dnf-automatic.timer


・yum-cron の自動起動設定

[root@centos]# systemctl enable dnf-automatic.timer