5

I can't upgrade Ubuntu 16.04 because it complains that a reboot is needed. But after rebooting, the same error message is displayed again.

$ 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 Answers1

6

Check if you have a file /var/run/reboot-required and if yes, delete it.

HuHa
  • 3,385
  • 1
    Yes, I do have that file. I deleted it and tried the "do-release-upgrade" and it failed with the same error. I then rebooted and tried the upgrade and got the same error. Any other ideas? – Tristan Rhodes Apr 14 '21 at 19:55
  • 3
    There is a second file called "/var/run/reboot-required.pkg". When I deleted this file, the upgrade would start successfully. Thanks for the help, and hopefully this post will help someone else! – Tristan Rhodes Apr 15 '21 at 23:12
  • 2
    On my Ubuntu 20.04, the two files to delete are /run/reboot-required and /run/reboot-required.pkgs – Robert Metzger Jan 05 '22 at 07:53