Ubuntu 16.04 to 18.04 aborted upgrade

I am trying to upgrade from 16.04 to 18.04. The output for sudo do-release-upgrade ended with:

 ubuntu-desktop
Exception during pm.DoInstall(): E:Sub-process /usr/bin/dpkg returned an error code (1)
Could not install the upgrades
The upgrade has aborted. Your system could be in an unusable state. A
recovery will run now (dpkg --configure -a).
dpkg: dependency problems prevent configuration of ubuntu-desktop: ubuntu-desktop depends on gdm3; however: Package gdm3 is not installed. ubuntu-desktop depends on gnome-shell; however: Package gnome-shell is not installed. ubuntu-desktop depends on software-properties-gtk; however: Package software-properties-gtk is not installed.
dpkg: error processing package ubuntu-desktop (--configure): dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of software-properties-common: gnupg (2.2.4-1ubuntu1) breaks software-properties-common (<= 0.96.24.3) and is installed. Version of software-properties-common to be configured is 0.96.20.10.
dpkg: error processing package software-properties-common (--configure): dependency problems - leaving unconfigured
Errors were encountered while processing: ubuntu-desktop software-properties-common
Upgrade complete
The upgrade has completed but there were errors during the upgrade
process.
To continue please press [ENTER]

The output for sudo apt update is:

Hit:1 bionic InRelease
Get:2 bionic/main DEP-11 48x48 Icons [118 kB]
Fetched 118 kB in 2s (49.3 kB/s)
Reading package lists... Done
E: No priority (or zero) specified for pin

and sudo dpkg --configure -a gives:

dpkg: dependency problems prevent configuration of ubuntu-desktop: ubuntu-desktop depends on gdm3; however: Package gdm3 is not installed. ubuntu-desktop depends on gnome-shell; however: Package gnome-shell is not installed. ubuntu-desktop depends on software-properties-gtk; however: Package software-properties-gtk is not installed.
dpkg: error processing package ubuntu-desktop (--configure): dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of software-properties-common: gnupg (2.2.4-1ubuntu1) breaks software-properties-common (<= 0.96.24.3) and is installed. Version of software-properties-common to be configured is 0.96.20.10.
dpkg: error processing package software-properties-common (--configure): dependency problems - leaving unconfigured
Errors were encountered while processing: ubuntu-desktop software-properties-common

Finally, the output for apt-cache policy:

Package files: 100 /var/lib/dpkg/status release a=now 500 bionic/main i386 Packages release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=i386 origin archive.ubuntu.com 500 bionic/main amd64 Packages release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=amd64 origin archive.ubuntu.com
Pinned packages:
E: No priority (or zero) specified for pin

I haven't rebooted the computer. How do I ensure everything (or at least package management) is working?

2

1 Answer

To remove "E: No priority (or zero) specified for pin" message you have to remove the Ubuntu Advantage (UA) ESM files by

sudo rm /etc/apt/preferences.d/ubuntu-esm-infra
sudo rm /etc/apt/sources.list.d/ubuntu-esm-infra.list

as Ubuntu 18.04 LTS is supported release, so no UA ESM is really needed here.

Then check that you have correct lines in the /etc/apt/sources.list. Change lines to contain the following:

deb bionic main restricted universe multiverse
deb bionic-updates main restricted universe multiverse
deb bionic-security main restricted universe multiverse
deb bionic-backports main restricted universe multiverse

Then run sudo apt-get update again followed by:

sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get upgrade # rerun upgrade
sudo apt-get dist-upgrade # install newest dependencies

And finally remove UA with

sudo apt-get purge ubuntu-advantage-tools --autoremove

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like