无法升级 Ubuntu 16.04,因为“需要重新启动”错误永远不会消失(即使重新启动后)

无法升级 Ubuntu 16.04,因为“需要重新启动”错误永远不会消失(即使重新启动后)

我无法升级 Ubuntu 16.04,因为它抱怨需要重新启动。但重新启动后,再次显示相同的错误消息。

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"

$ sudo apt update
...
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ sudo do-release-upgrade
Checking for a new Ubuntu release
You have not rebooted after updating a package which requires a reboot. Please reboot before upgrading.

$ uptime
 13:13:17 up 0 min,  3 users,  load average: 0.08, 0.02, 0.01

$ cat /var/run/reboot-required.pkgs | wc -l
480

$ cat /var/run/reboot-required.pkgs | head -n 10
linux-image-3.2.0-34-generic
linux-base
linux-image-3.2.0-35-generic
linux-base
linux-image-3.2.0-36-generic
linux-base
linux-image-3.2.0-37-generic
linux-base
libssl1.0.0
linux-image-3.2.0-38-generic

$ cat /var/run/reboot-required.pkgs | tail -n 10
linux-base
libssl1.0.0
linux-base
libssl1.0.0
linux-base
libssl1.0.0
linux-base
linux-base
linux-base
linux-base

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev
tmpfs           597M  8.2M  589M   2% /run
/dev/sda1       9.2G  5.8G  3.0G  67% /
tmpfs           3.0G     0  3.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.0G     0  3.0G   0% /sys/fs/cgroup
/dev/sda6       257G  220G   24G  91% /usr/local/nfsen/profiles-data
cgmfs           100K     0  100K   0% /run/cgmanager/fs
tmpfs           597M     0  597M   0% /run/user/1002

答案1

检查您是否有文件/var/run/reboot-required,如果有,则将其删除。

相关内容