我只是安装了一些更新在我的Ubuntu服务器上。 其中一些是内核和Linux的头,所以我怀疑需要重启,但我想知道肯定。 所以, 从这个网站的build议 ,我安装了checkrestart 。
$ checkrestart ERROR: This program must be run as root in order to obtain information about all open file descriptors in the system. $ sudo !! sudo checkrestart Found 0 processes using old versions of upgraded files
嗯。 不需要重新启动? 这似乎很奇怪。
$ exit logout Connection to example.net closed. $ ssh [email protected] && alert [email protected]'s password: Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-92-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud 0 packages can be updated. 0 updates are security updates. *** System restart required ***
哦。 所以需要重启? 你为什么不这样说?
$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
如何知道安装更新后是否需要重新启动?
因为这不是checkrestart所做的。
它本质上是做的是检查是否有任何进程保持文件句柄打开旧/重写库等,内核将不是该列表的一部分,因为它不是一个进程保持句柄的文件。
如果确实需要重启,更新过程应该创build一个名为/var/run/reboot-required的文件(请参阅https://askubuntu.com/questions/164/how-can-i-tell-from-the-command-无论是否需要机器重新启动 )