嗯,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)?
如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。
如本文对您有用,捐赠和留言 将是对我最好的支持~(捐赠可转为站内积分)
如愿意,请向朋友推荐本站,谢谢。
尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。
留言