Failed Zorin OS 16.3 -> 17 Upgrade - Please help me fix it

Hey, I've tried to Upgrade my Zorin OS Pro Lite installation through the provided tool. It quickly failed, when I ran apt-get update on the commandline I was met with this message.

Err:15 https://packages.mozilla.org/apt mozilla InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY

I fixed it by running the following commands and verified, that the command does now work correctly

sebastian@sebastian-linux:~/Documents/Coding/nethogs$ gpg --keyserver keyserver.ubuntu.com --recv-keys  C0BA5CE6DC6315A3
gpg: key C0BA5CE6DC6315A3: public key "Artifact Registry Repository Signer <artifact-registry-repository-signer@google.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
sebastian@sebastian-linux:~/Documents/Coding/nethogs$ gpg --export --armor C0BA5CE6DC6315A3 | sudo apt-key add - && sudo apt-get update
OK

After that I ran the upgrade utility again, it got further into the upgrade process and then failed again. Now I feel like I am stuck.

sudo apt-get update
Get:1 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  InRelease [1.484 B]
Hit:2 http://ppa.launchpad.net/zorinos/apps/ubuntu jammy InRelease                                                                                                                                     
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                                                                                                       
Hit:4 http://de.archive.ubuntu.com/ubuntu jammy InRelease                                                                                                                                              
Hit:5 http://ppa.launchpad.net/zorinos/drivers/ubuntu jammy InRelease                                                                                                                                  
Hit:6 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease                                                                                                                                      
Hit:7 http://ppa.launchpad.net/zorinos/patches/ubuntu jammy InRelease                                                                                                                                  
Hit:8 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease                                                                                                                                    
Hit:9 https://linux.teamviewer.com/deb stable InRelease                                                                                                                                                
Get:10 https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04 ./ InRelease [1.559 B]                                                                                         
Hit:11 http://ppa.launchpad.net/zorinos/stable/ubuntu jammy InRelease                                                                                                                                  
Hit:12 https://packages.microsoft.com/repos/code stable InRelease                                                                                                          
Ign:13 https://repo.vivaldi.com/stable/deb stable InRelease                                                                                          
Hit:14 https://repo.vivaldi.com/stable/deb stable Release                                         
Hit:15 https://packages.mozilla.org/apt mozilla InRelease                   
Hit:16 https://packages.zorinos.com/stable jammy InRelease                  
Hit:17 https://packages.zorinos.com/patches jammy InRelease
Hit:19 https://packages.zorinos.com/apps jammy InRelease
Hit:20 https://packages.zorinos.com/drivers jammy InRelease
Hit:21 https://packages.zorinos.com/premium jammy InRelease
Fetched 3.043 B in 2s (1.759 B/s)
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 12, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libapt-pkg-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-gobject-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-perl : Depends: perlapi-5.30.0 but it is not installable
 libfile-fcntllock-perl : Depends: perlapi-5.30.0 but it is not installable
 libgjs0g : Depends: libgirepository-1.0-1 (>= 1.71.0) but 1.64.1-1~ubuntu20.04.1 is installed
            Depends: libgirepository-1.0-1-with-libffi8 (>= 1.64)
 libglib-object-introspection-perl : Depends: perlapi-5.30.0 but it is not installable
 python3 : PreDepends: python3-minimal (= 3.8.2-0ubuntu2) but 3.10.6-1~22.04 is installed
           Depends: libpython3-stdlib (= 3.8.2-0ubuntu2) but 3.10.6-1~22.04 is installed
 python3-yaml : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libapt-pkg-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-gobject-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-perl : Depends: perlapi-5.30.0 but it is not installable
 libfile-fcntllock-perl : Depends: perlapi-5.30.0 but it is not installable
 libgjs0g : Depends: libgirepository-1.0-1 (>= 1.71.0) but 1.64.1-1~ubuntu20.04.1 is installed
            Depends: libgirepository-1.0-1-with-libffi8 (>= 1.64)
 libglib-object-introspection-perl : Depends: perlapi-5.30.0 but it is not installable
 python3 : PreDepends: python3-minimal (= 3.8.2-0ubuntu2) but 3.10.6-1~22.04 is installed
           Depends: libpython3-stdlib (= 3.8.2-0ubuntu2) but 3.10.6-1~22.04 is installed
 python3-yaml : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

apt-mark showhold returns nothing.

If I were you, I'll disable all the 3rd party repositories. IT could be that you have added so much non-standard that it's impossible to do a upgrade.

Ok noted and done. Still stuck in this error loop

sebastian@sebastian-linux:/etc/apt/sources.list.d$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libapt-pkg-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-gobject-perl : Depends: perlapi-5.30.0 but it is not installable
 libcairo-perl : Depends: perlapi-5.30.0 but it is not installable
 libfile-fcntllock-perl : Depends: perlapi-5.30.0 but it is not installable
 libgjs0g : Depends: libgirepository-1.0-1 (>= 1.71.0) but 1.64.1-1~ubuntu20.04.1 is installed
            Depends: libgirepository-1.0-1-with-libffi8 (>= 1.64)
 libglib-object-introspection-perl : Depends: perlapi-5.30.0 but it is not installable
 python3 : PreDepends: python3-minimal (= 3.8.2-0ubuntu2) but 3.10.6-1~22.04 is installed
           Depends: libpython3-stdlib (= 3.8.2-0ubuntu2) but 3.10.6-1~22.04 is installed
 python3-yaml : Depends: python3 (>= 3.10~) but 3.8.2-0ubuntu2 is installed
N: Ignoring file 'filebot.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'keepsolidinc.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'mozilla.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'vscode.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'nvidia-container-toolkit.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'marin-m-ubuntu-songrec-focal.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'teamviewer.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'deadsnakes-ubuntu-ppa-focal.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'appimagelauncher-team-ubuntu-stable-focal.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'docker.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'nodesource.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'vivaldi.list-disabled' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

Have you added/modified/upgraded python on your system?

The last python & apt related stuff I found in the bash history was

469  2024-04-27 14:00:05 sudo apt install python3-pip python3-setuptools python3-venv
470  2024-04-27 14:00:14 python3 -m pip install --user pipx
471  2024-04-27 14:00:22 python3 -m pipx ensurepath
649  2024-05-19 21:07:41 sudo apt-get install python3-pyqt5 python3-pyparsing python3-mutagen

Other than that.. I don't really know :frowning: It's a 2 year old system so far.

At this point a fresh install is to be consider instead of time consuming debugging, because you are what they call in "dependency hell" for some reason. Do you have seperated /home partition?

1 Like

Sadly not, is there a way to keep it when reinstalling it?

You can backup via extern HDD or the cloud your home directory. Then move it back when done re-installing.

1 Like

Thank you, I will do that. In future installs, I should just ensure I have a separate /home partition, I guess?
What should I have done to avoid these conflicts in the upgrade progress, stay away from non-official repos?

If possible and find the apps in the software center. The only good thing I can say about flatpak and snaps is that they are independently of the system.