半夜自动升级把服务重启了,关掉无人值守更新

半夜重启多半是自动升级干的。

先看 /etc/apt/apt.conf.d/20auto-upgrades。

把引号里的 1 全改成 0,定期更新和升级都停。

服务名是 unattended-upgrades,用 systemctl 禁掉。

最后查一遍定时器,确认 apt-daily 没残留。

安全补丁别彻底不管,改成自己排期手动打。

# 文件里两个开关都置 0
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";

# 或者用命令行重配,弹窗里选 No
sudo dpkg-reconfigure unattended-upgrades

# 停服务并禁用开机自启
sudo systemctl disable --now unattended-upgrades

# 确认定时器状态
systemctl list-timers apt-daily.timer apt-daily-upgrade.timer
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容