0

I recently tried a dist-upgrade from 16.04 to 18.04. During the upgrade process, it reported problems with broken dependencies. I noted the packages, hoping I could fix the problem later.

Now I seem to be stuck in a place where I can't to either install, fix or uninstall packages.

First, my repositories:

ralmond@Limu:~$ cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 
(20120425)]/ dists/precise/main/binary-i386/

# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120425)]/ precise main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

# deb http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu trusty/ # disabled on upgrade to trusty disabled on upgrade to xenial
# deb https://mirrors.nics.utk.edu/cran/linux/ubuntu xenial main
# deb-src https://mirrors.nics.utk.edu/cran/linux/ubuntu xenial main
# deb http://cran.rstudio.com/bin/linux/ubuntu xenial/ # disabled on upgrade to bionic

I manually commented out the precise partner repo as that was possibly a problem. All other older repos in sources.list and sources.list.d were commented out.

I try to run apt-get -f install to fix the broken dependencies, but I get

ralmond@Limu:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
    debhelper : Depends: dh-autoreconf (>= 17~) but it is not installed
         Depends: dh-strip-nondeterminism (>= 0.028~) but 0.015-1 is installed
     libglib2.0-bin : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is installed
     libhtml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is installed
                   Depends: perlapi-5.26.0
     libnet-ssleay-perl : Depends: perl (>= 5.26.1-4build1) but 5.22.1-9ubuntu0.5 is installed
                  Depends: perlapi-5.26.1
     libxml-libxml-perl : Depends: perl (>= 5.26.1-2ubuntu1) but 5.22.1-9ubuntu0.5 is installed
                  Depends: perlapi-5.26.1
     libxml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is installed
                  Depends: perlapi-5.26.0
     systemd : Depends: libsystemd0 (= 229-4ubuntu21.2) but 237-3ubuntu10 is installed
     texlive-binaries : Depends: libharfbuzz0b (>= 1.4.1) but 1.0.1-1ubuntu0.1 is installed
                Depends: libmpfr6 (>= 3.1.3) but it is not installed
                Depends: libpoppler73 (>= 0.62.0) but it is not installed
     texlive-extra-utils : Depends: libunicode-linebreak-perl but it is not installed
     texlive-generic-extra : Depends: texlive-plain-generic (>= 2017.20170628) but it is not installed
     texlive-generic-recommended : Depends: texlive-plain-generic (>= 2017.20170628) but it is not installed
     texlive-lang-chinese : Depends: fonts-arphic-bkai00mp but it is not installed
                    Depends: fonts-arphic-bsmi00lp but it is not installed
                    Depends: fonts-arphic-gbsn00lp but it is not installed
                    Depends: fonts-arphic-gkai00mp but it is not installed
   texlive-lang-korean : Depends: fonts-baekmuk but it is not installed
                   Depends: fonts-unfonts-extra but it is not installed
   texlive-lang-other : Depends: fonts-sil-padauk (>= 3.003-1) but 2.80-2 is installed
   texlive-plain-extra : Depends: texlive-plain-generic (>= 2017.20170628) but it is not installed
   texlive-pstricks : Depends: texlive-plain-generic (>= 2017.20170628) but it is not installed
   texlive-science : Depends: texlive-lang-greek (>= 2017.20170628) but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

There are no held packages:

ralmond@Limu:~$ sudo apt-mark showhold
ralmond@Limu:~$ 

If I try a dist-upgrade again, I get very similar error messages:

ralmond@Limu:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
     debhelper : Depends: dh-autoreconf (>= 17~) but it is not installed
         Depends: dh-strip-nondeterminism (>= 0.028~) but 0.015-1 is installed
     libglib2.0-bin : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is installed
... [Removing nearly identical list of broken packages.]
E: Unmet dependencies. Try using -f.

The -f option doesn't seem to help.

ralmond@Limu:~$ sudo apt-get -f dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
      debhelper : Depends: dh-autoreconf (>= 17~) but it is not installed
         Depends: dh-strip-nondeterminism (>= 0.028~) but 0.015-1 is installed
...
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

Removing a package has similar issues:

ralmond@Limu:~$ sudo apt-get -f remove debhelper
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
  alien : Depends: debhelper (>= 7) but it is not going to be installed
  dh-strip-nondeterminism : Depends: debhelper but it is not going to be installed
  dh-translations : Depends: debhelper but it is not going to be installed
  libglib2.0-bin : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is to be installed
  libhtml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is to be installed
                   Depends: perlapi-5.26.0
  libnet-ssleay-perl : Depends: perl (>= 5.26.1-4build1) but 5.22.1-9ubuntu0.5 is to be installed
                  Depends: perlapi-5.26.1
  libxml-libxml-perl : Depends: perl (>= 5.26.1-2ubuntu1) but 5.22.1-9ubuntu0.5 is to be installed
                  Depends: perlapi-5.26.1
  libxml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is to be installed
                  Depends: perlapi-5.26.0
  systemd : Depends: libsystemd0 (= 229-4ubuntu21.2) but 237-3ubuntu10 is to be installed
  texlive-binaries : Depends: libharfbuzz0b (>= 1.4.1) but 1.0.1-1ubuntu0.1 is to be installed
                Depends: libmpfr6 (>= 3.1.3) but it is not going to be installed
                Depends: libpoppler73 (>= 0.62.0) but it is not going to be installed
  texlive-extra-utils : Depends: libunicode-linebreak-perl but it is not going to be installed
  texlive-generic-extra : Depends: texlive-plain-generic (>= 2017.20170628) but it is not going to be installed
  texlive-generic-recommended : Depends: texlive-plain-generic (>= 2017.20170628) but it is not going to be installed
  texlive-lang-chinese : Depends: fonts-arphic-bkai00mp but it is not going to be installed
                    Depends: fonts-arphic-bsmi00lp but it is not going to be installed
                    Depends: fonts-arphic-gbsn00lp but it is not going to be installed
                    Depends: fonts-arphic-gkai00mp but it is not going to be installed
  texlive-lang-korean : Depends: fonts-baekmuk but it is not going to be installed
                   Depends: fonts-unfonts-extra but it is not going to be installed
  texlive-lang-other : Depends: fonts-sil-padauk (>= 3.003-1) but 2.80-2 is to be installed
  texlive-plain-extra : Depends: texlive-plain-generic (>= 2017.20170628) but it is not going to be installed
  texlive-pstricks : Depends: texlive-plain-generic (>= 2017.20170628) but it is not going to be installed
  texlive-science : Depends: texlive-lang-greek (>= 2017.20170628) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

It really looks like somehow debhelper is broken. I'm afraid to get too aggressive about removing it for fear that I will break the entire debian system and not be able to move forwards or backwards.

Thanks in advance for any help or suggestions about what to try next.

Update 1: Following this link (Unmet dependencies error). It suggested trying dpkg --purge --pending. This did not solve my problem, but I think it provided a clue. Here is the output:

ralmond@Limu:~$ sudo dpkg --purge --pending
[sudo] password for ralmond: 
dpkg: dependency problems prevent removal of texlive:
  mathtex depends on texlive.

dpkg: error processing package texlive (--purge):
  dependency problems - not removing
(Reading database ... 545797 files and directories currently installed.)
Removing systemd-shim (9-1bzr4ubuntu1) ...
Removing 'diversion of /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service to /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd by systemd-shim'
  dpkg-divert: error: rename involves overwriting '/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service' with
  different file '/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd', not allowed
dpkg: error processing package systemd-shim (--purge):
  installed systemd-shim package post-removal script subprocess 
returned error exit status 2
Errors were encountered while processing:
  texlive
  systemd-shim
ralmond
  • 11
  • Did you do a Debian style dist-upgrade? Or did you do an Ubuntu-style do-release-upgrade? They are different, the wrong one may break your Ubuntu system. – user535733 Jul 07 '18 at 03:11
  • Here is the sequence of commands I used to do the upgrade: 156 sudo apt dist-update 157 sudo apt dist-upgrade 158 sudo apt update 159 sud apt autoremove 160 sudo apt autoremove 161 sudo emacs -nw /etc/update-manager/release-upgrades 162 sudo do-release-upgrade -d – ralmond Jul 07 '18 at 03:17
  • Seems like you used the wrong one. Back up your data. Then run do-release-upgrade. It might save your system, it might not. Ubuntu is based closely upon Debian, but there are important differences. – user535733 Jul 07 '18 at 03:26
  • Unfortunately, that gives me 'Searching for a new Ubuntu release. No new release found.' so it doesn't fix the problem. – ralmond Jul 07 '18 at 03:29
  • You have two choices: Reinstall, or tediously sifting all those packages manually until you find the held package that's preventing the rest from upgrading. Your choice. – user535733 Jul 07 '18 at 03:36
  • File a bug report against the package missing dependencies – Panther Jul 07 '18 at 04:11
  • the do-release-upgrade to 18.04 isn't visible to 16.04, until after 18.04.1 is released; so 'no release found' is still correct. That path isn't expected to be opened until a few days after 26-July-2018. The -d may get you to 18.04 now if you don't want to wait (but be careful you don't jump to 18.10) – guiverc Jul 07 '18 at 04:46
  • Are you sure that you do not have PPAs added in /etc/apt/sources.list/*.list files? Did you try sudo aptitude safe-upgrade? – N0rbert Jul 07 '18 at 10:41
  • I checked everything in '/etc/apt/sources.list.d/*.list' and they are all commented out. I don't have 'aptitude' installed and 'apt-get install' also seems to be broken. – ralmond Jul 07 '18 at 14:17

1 Answers1

0

I think I found an answer. It is slow and painful, but I hope it will get me there. (I'm partway through).

1) First I removed as many packages as I could using dpkg -r(for example, all of the texlive packages are not system critical and I can reinstall them later, so I cleaned as many of those as I could.

2) For the packages that are actually part of the system, I used the following steps:

a) Use sudo apt-get -f install to check what is still broken.

ralmond@Limu:~/packageDepot$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libglib2.0-bin : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is installed
 libhtml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is installed
                   Depends: perlapi-5.26.0
 libnet-ssleay-perl : Depends: perl (>= 5.26.1-4build1) but 5.22.1-9ubuntu0.5 is installed
                  Depends: perlapi-5.26.1
 libxml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is installed
                  Depends: perlapi-5.26.0
 systemd : Depends: libsystemd0 (= 229-4ubuntu21.2) but 237-3ubuntu10 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

2) Working one package at a time, use apt-get install to check for missing dependencies. Next on the list is glib2, so:

ralmond@Limu:~/packageDepot$ sudo apt-get install libglib2.0-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
   libglib2.0-0 : Breaks: libglib2.0-0:i386 (!= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is to be installed
   libglib2.0-0:i386 : Breaks: libglib2.0-0 (!= 2.48.2-0ubuntu1) but 2.56.1-2ubuntu1 is to be installed
   libhtml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is to be installed
   ... 
   E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Ah! There is a dependency on the i386 version. Run again to check that the i386 version doesn't have any dependencies.

ralmond@Limu:~/packageDepot$ sudo apt-get install libglib2.0-0 libglib2.0-0:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
   libhtml-parser-perl : Depends: perl (>= 5.26.0-4) but 5.22.1-9ubuntu0.5 is to be installed
   ... [Same list of packages]
   E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Next, I manually download the files using apt-get download. Note, don't run this as root or the files will not be deletable without sudo.

ralmond@Limu:~/packageDepot$ apt-get download libglib2.0-0 libglib2.0- 0:i386
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libglib2.0-0 amd64 2.56.1-2ubuntu1 [1,167 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main i386 libglib2.0-0 i386 2.56.1-2ubuntu1 [1,232 kB]
Fetched 2,399 kB in 7s (323 kB/s)                                              

Now manually install using dpkg -i.

ralmond@Limu:~/packageDepot$ sudo dpkg -i ./libglib*
(Reading database ... 421587 files and directories currently installed.)
 Preparing to unpack .../libglib2.0-0_2.56.1-2ubuntu1_amd64.deb ...
 De-configuring libglib2.0-0:i386 (2.48.2-0ubuntu1) ...
 Unpacking libglib2.0-0:amd64 (2.56.1-2ubuntu1) over (2.48.2-0ubuntu1) ...
 Preparing to unpack .../libglib2.0-0_2.56.1-2ubuntu1_i386.deb ...
 Unpacking libglib2.0-0:i386 (2.56.1-2ubuntu1) over (2.48.2-0ubuntu1) ...
 Setting up libglib2.0-0:amd64 (2.56.1-2ubuntu1) ...
 Setting up libglib2.0-0:i386 (2.56.1-2ubuntu1) ...
 Processing triggers for libc-bin (2.27-3ubuntu1) ...

Now back to apt-get -f install to fix the next problem.

I'll update if I discover more steps are needed.

ralmond
  • 11
  • Eventually, drilling down in this way, I discovered that ubuntu-release-updater-core and update-manager-core were among the broken packages. Fixing those seems to have fixed apt-get -f install. – ralmond Jul 08 '18 at 00:22
  • Thanks for the write up. After running the below many many times, I finally fixed all the broken packages. "apt install -f" "apt download ..." "dpkg -i ..." – niknah Jul 25 '19 at 11:46