Fedora系统自动更新¶
和 Ubuntu无人值守升级 相似,Fedora也有自动 DNF包管理器 更新方法,可以方便我们维护大量的Red Hat Linux。
备注
对于关键性服务器,建议不要启用自动更新,以免导致兼容性故障。对于生产关键性服务器,应该采用严格的测试和灰度,并自己把控更新方式。
dnf-automatic
软件包提供了 DNF包管理器 组件自动更新服务
安装
dnf-automatic
:
sudo dnf install dnf-automatic
默认情况下
dnf-automatic
只是下载软件包,但是不安装,所以需要修订/etc/dnf/automatic.conf
:
sudo cp /etc/dnf/automatic.conf /etc/dnf/automatic.conf_`date +%Y-%m-%d_%H:%M:%S`
sudo sed -i 's/apply_updates = no/apply_updates = yes/g' /etc/dnf/automatic.conf
运行并激活 Systemd进程管理器 的
dnf-automatic.timer
定时器:
sudo systemctl enable --now dnf-automatic.timer