在 Ubuntu 22.04 以及更新版本中,你可能会在登录终端时看到如下提示:
14 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
这实际上是 Canonical 推出的 Ubuntu Pro(原名 Ubuntu Advantage)服务中的一部分 —— ESM Apps(Extended Security Maintenance)。
这项服务会为 universe
软件仓库中的一些非官方软件包提供额外的安全更新支持。
如果你并不打算启用 Ubuntu Pro,那么这个提示就显得有些“打扰”。本文将介绍如何彻底禁用它。
Ubuntu Pro / ESM 是什么?
- Ubuntu Pro 是 Canonical 提供的一个增强版支持服务。
- ESM (Extended Security Maintenance) 是其中一项服务,提供对 LTS 版本生命周期结束后仍继续的安全补丁。
- 对于个人用户,每个 Ubuntu One 账户可以免费使用 最多 5 台设备 的 Ubuntu Pro。
如果你确实需要 ESM 安全支持,可以参考:https://ubuntu.com/pro
如何判断是否启用了 Ubuntu Pro?
可以运行以下命令检查当前系统状态:
pro status
如果你没有启用,会看到类似:
Service Status
...
esm-apps disabled
为什么会有 ESM 提示?
这个提示是系统登录时自动运行的一组 MOTD
(Message of the Day)脚本输出的结果,具体是 /etc/update-motd.d/91-contract-ua-esm-status
脚本。
如何禁用 ESM 提示?
只需禁用对应的提示脚本即可。 如何禁用 ESM 提示? 只需禁用对应的提示脚本即可。
1. 禁用 ESM 提示脚本
sudo chmod -x /etc/update-motd.d/91-contract-ua-esm-status
2. 可选:禁用其它 MOTD 相关提示(例如广告、Livepatch、升级提示等)
# 禁用 MOTD 新闻广告
sudo chmod -x /etc/update-motd.d/50-motd-news
# 禁用软件更新数量提示
sudo chmod -x /etc/update-motd.d/90-updates-available
# 禁用硬件支持过期提示
sudo chmod -x /etc/update-motd.d/95-hwe-eol
如何验证是否生效?
你可以手动执行登录提示脚本来检查输出是否已经干净:
run-parts /etc/update-motd.d/
或者重新连接 SSH / 打开一个新的终端窗口。
如果想彻底关闭所有 MOTD 提示怎么办?
如果你完全不想看到任何登录提示,也可以一键禁用所有 /etc/update-motd.d
中的脚本:
sudo chmod -x /etc/update-motd.d/*
但请注意,这也会禁用系统版本、更新、重启等有用提示,请谨慎操作。
总结
Ubuntu 的 ESM 提示并不影响系统正常使用,也没有强制你开启。如果你不打算启用 Ubuntu Pro,可以通过简单地禁用相关 MOTD 脚本来让终端界面更清爽。
希望本文对你有所帮助。如果你觉得 MOTD 系统提示烦人,不妨照着操作一次!
参考资料
-
man update-motd
-
man run-parts