Comment 10 for bug 1960582

Revision history for this message
Gene Weber (gene-weber) wrote :

I ran into this same problem when doing a release upgrade on an AWS EC2 instance. I have not been able to fix a broken upgrade, but here is how to do a successful upgrade.

An "ls" on a brand new EC2 instance running 20.04.1 shows this:

$ ls -lat /var/lib/dpkg
total 1752
drwxr-xr-x 2 root root 4096 Sep 1 09:19 updates
drwxr-xr-x 7 root root 4096 Sep 1 09:19 .
-rw-r--r-- 1 root root 706338 Sep 1 09:19 status
-rw-r----- 1 root root 0 Sep 1 09:19 lock
-rw-r--r-- 1 root root 706377 Sep 1 09:19 status-old
drwxr-xr-x 2 root root 143360 Sep 1 09:19 info
drwxr-xr-x 47 root root 4096 Sep 1 09:19 ..
drwxr-xr-x 2 root root 4096 Sep 1 09:19 triggers
-rw-r--r-- 1 root root 135 Sep 1 09:19 statoverride
drwxr-xr-x 2 root root 4096 Sep 1 09:19 alternatives
-rw-r--r-- 1 root root 268 Nov 29 2021 diversions
-rw-r--r-- 1 root root 336 Nov 29 2021 diversions-old
-rw-r--r-- 1 root root 100 Nov 29 2021 statoverride-old
-rw-r----- 1 root root 0 Nov 29 2021 lock-frontend
-rw-r--r-- 1 root root 181566 Nov 29 2021 available
-rw-r--r-- 1 root root 8 Nov 29 2021 cmethopt
drwxr-xr-x 2 root root 4096 Mar 23 2020 parts

Trying to run a "do-release-upgrade" will not work if any 20.04.01 packages need to be upgraded. If "sudo apt upgrade" is run, "ls" now shows this:

$ ls -lat /var/lib/dpkg
total 1752
drwxr-xr-x 7 root root 4096 Sep 1 09:23 .
lrwxrwxrwx 1 root root 13 Sep 1 09:23 dpkg -> /var/lib/dpkg
drwxr-xr-x 2 root root 4096 Sep 1 09:21 updates
-rw-r--r-- 1 root root 707850 Sep 1 09:21 status
drwxr-xr-x 2 root root 143360 Sep 1 09:21 info
-rw-r----- 1 root root 0 Sep 1 09:21 lock
-rw-r----- 1 root root 0 Sep 1 09:21 lock-frontend
-rw-r--r-- 1 root root 707587 Sep 1 09:21 status-old
drwxr-xr-x 47 root root 4096 Sep 1 09:19 ..
drwxr-xr-x 2 root root 4096 Sep 1 09:19 triggers
-rw-r--r-- 1 root root 135 Sep 1 09:19 statoverride
drwxr-xr-x 2 root root 4096 Sep 1 09:19 alternatives
-rw-r--r-- 1 root root 268 Nov 29 2021 diversions
-rw-r--r-- 1 root root 336 Nov 29 2021 diversions-old
-rw-r--r-- 1 root root 100 Nov 29 2021 statoverride-old
-rw-r--r-- 1 root root 181566 Nov 29 2021 available
-rw-r--r-- 1 root root 8 Nov 29 2021 cmethopt
drwxr-xr-x 2 root root 4096 Mar 23 2020 parts

Proceeding with "do-release-upgrade" at this point breaks. But if I "sudo unlink /var/lib/dpkg/dpkg" before doing the "do-release-upgrade", the upgrade to 22.04 is successful.