CentOS 和 RHEL 8 或更高版本
在 CentOS 與 RHEL 8 或更新版本上,建議使用 dnf-automatic 套件:
dnf install dnf-automatic
在 /etc/dnf/automatic.conf 設置:
download_updates = yes
apply_updates = yes
啟用與開始自動更新透過:
systemctl enable --now dnf-automatic.timer
檢查 dnf-automatic 狀態:
systemctl list-timers *dnf-*
CentOS 和 RHEL 7 或更早版本
對於CentOS和RHEL 7或更早版本, yum-cron包是首選方法:
yum install yum-cron
對 /etc/yum/yum-cron.conf 設定:
download_updates = yes
apply_updates = yes
啟用與開始自動更新透過:
systemctl start yum-cron.service
openSUSE
首先,您需要安裝自動更新套件
zypper install yast2-online-update-configuration
然後使用以下指令啟動設定工具(基於 ncurses):
yast2 online_update_configuration
啟用以下設定:
Automatic Online Update
Interval: Daily
Skip Interactive Patches
Agree with Licenses
Use delta rpms
確認配置沒問題請按 OK。
官方 openSUSE 文件請見 here。