在 Debian 里“屏蔽 message”通常指不显示/不记录系统消息,不同场景做法不一样。下面按常见情况给你说明:
sudo rm -f /etc/motd
sudo systemctl disable motd-news.service
或编辑:
sudo nano /etc/pam.d/login
# 注释掉包含 motd 的行
mesg n
(只对当前终端有效,重启失效)
永久生效可加到:
echo "mesg n" >> ~/.bashrc
journalctl -p err # 只看错误
sudo systemctl stop systemd-journald
sudo systemctl disable systemd-journald
⚠️ 不推荐,会影响排错
sudo dmesg -n 1
或永久:
echo "kernel.printk = 1 1 1 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
sudo apt-get -qq install xxx
或重定向:
apt upgrade > /dev/null 2>&1
sudo systemctl stop exim4
sudo systemctl disable exim4
gsettings set org.gnome.desktop.notifications show-banners false
如果你能说明 具体是哪一种 message(终端?日志?邮件?桌面弹窗?),我可以给你更精准的命令。