为 apt-get 升级设置 cron 作业是否安全?

为 apt-get 升级设置 cron 作业是否安全?

为我的网络服务器创建一个 cron 作业是个好主意吗apt-get update; apt-get upgrade

所以不是 apt-get dist-upgrade

答案1

是的,在有限的范围内。但你不必这样做。有一个名为 的软件包 unattended-upgrades可以为您完成此操作。

Description-en: automatic installation of security upgrades
 This package can download and install security upgrades automatically
 and unattended, taking care to only install packages from the
 configured APT source, and checking for dpkg prompts about
 configuration file changes.
 .
 This script is the backend for the APT::Periodic::Unattended-Upgrade
 option.

正如描述所示,该软件包旨在与安全升级一起使用。自动安装安全升级是一个相当安全的选择。进行其他类型的无人值守升级风险更大。

答案2

这取决于:这个问题会得到不同的意见。我的经验是,后续 Debian 测试需要频繁干预,以防止升级受阻。此外,由于升级而导致的损坏(并不罕见),包括 NFS 和内核升级的持续问题。

更一般地说,当您有时间从偶尔的故障中恢复时,系统升级效果会更好。

相关内容