请知悉:本文最近一次更新为 7个月 前,文中内容可能已经过时。

嗯,Ubuntu 20.04 官方源安装系统后,SSH登入后会提示:

New release '22.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

如何隐藏这个提示呢?

方法如下:


cat <<EOF > /etc/update-motd.d/91-release-upgrade
#!/bin/sh

# if the current release is under development there won't be a new one
if [ "\$(lsb_release -sd | cut -d' ' -f4)" = "(development" ]; then
exit 0
fi

# if it is non-root user, skip
if [ $(id -u) -ne 0 ]; then
exit 0
fi

#if [ -x /usr/lib/ubuntu-release-upgrader/release-upgrade-motd ]; then
# exec /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
#fi
EOF

其实就是注释掉了/etc/update-motd.d/91-release-upgrade最后3行代码。

或者干脆:

chmod -x /etc/update-motd.d/91-release-upgrade

参考资料

How to disable release upgrade notification at terminal/TTY login (not the GUI pop-up)?


如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《Ubuntu 20.04 如何隐藏Run ‘do-release-upgrade’ to upgrade to it.提示》相关的博文:


留言

avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌