yeni's Bin

Ubuntu 关闭 needrestart 输出

在一些 VPS 的 Ubuntu 模板中,运行 apt upgrade 的时候,会出现下面这些输出:

No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.

虽然无伤大雅,但有些碍眼,关闭的方法很简单:

#方法1
touch /etc/needrestart/conf.d/disable.conf
nano disable.conf
    #输入
    $nrconf{ucodehints} = 0;
---
#方法2
apt purge needrestart -y

ref