Following packages have unmet dependencies error

Hello I tried to upgrade from Zorin 15.3 Core to Zorin 16.3 Core but the system couldn't upgrade because of unmet dependencies error.

I tried multiple things I found online to correct that but it's now worse and showing a white exclamation mark in a red circle on the bottom right on the screen.

Here is what I get when I run this :
sudo apt-get -u dist-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:
binutils-x86-64-linux-gnu : Depends: libc6 (>= 2.38) but 2.28-0ubuntu1+zorin4 is installed
Depends: libctf-nobfd0 (>= 2.36) but it is not installed
Depends: libctf0 (>= 2.36) but it is not installed
Depends: libgprofng0 (>= 2.41) but it is not installed
Depends: libjansson4 (>= 2.14) but 2.11-1 is installed
Depends: libsframe1 (>= 2.41) but it is not installed
Depends: libstdc++6 (>= 13.1) but 8.4.0-1ubuntu1~18.04 is installed
Depends: libzstd1 (>= 1.5.5) but 1.3.3+dfsg-2ubuntu1.2 is installed
libbinutils : Depends: libc6 (>= 2.38) but 2.28-0ubuntu1+zorin4 is installed
Depends: libsframe1 but it is not installed
Depends: libzstd1 (>= 1.5.5) but 1.3.3+dfsg-2ubuntu1.2 is installed
libc-dev-bin : Depends: libc6 (> 2.39) but 2.28-0ubuntu1+zorin4 is installed
Recommends: libc-devtools (> 2.39)
libc6-dev : Depends: libc6 (= 2.39-0ubuntu8) but 2.28-0ubuntu1+zorin4 is installed
Depends: libcrypt-dev but it is not installed
Depends: rpcsvc-proto
libgcc-s1 : Depends: libc6 (>= 2.35) but 2.28-0ubuntu1+zorin4 is installed
libgcc-s1:i386 : Depends: libc6:i386 (>= 2.35) but it is not installed
locales : Depends: libc-bin (> 2.39)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

apt --fix-broken install
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

Did you try running this with sudo as well? sudo apt --fix-broken install.

1 Like

I did try with sudo but also give errors :
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libc-bin libc6 libc6:i386 libcrypt-dev libcrypt1 libctf-nobfd0 libctf0 libgprofng0 libidn2-0 libidn2-0:i386 libjansson4 libpam0g libsframe1 libstdc++6 libunistring5 libunistring5:i386 libzstd1 manpages manpages-dev rpcsvc-proto
Suggested packages:
glibc-doc libnss-nis libnss-nisplus glibc-doc:i386 locales:i386 libnss-nis:i386 libnss-nisplus:i386 libpam-doc
The following NEW packages will be installed:
libc6:i386 libcrypt-dev libcrypt1 libctf-nobfd0 libctf0 libgprofng0 libidn2-0:i386 libsframe1 libunistring5 libunistring5:i386 rpcsvc-proto
The following packages will be upgraded:
libc-bin libc6 libidn2-0 libjansson4 libpam0g libstdc++6 libzstd1 manpages manpages-dev
9 upgraded, 11 newly installed, 0 to remove and 2015 not upgraded.
8 not fully installed or removed.
Need to get 0 B/14,1 MB of archives.
After this operation, 24,0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
(Reading database ... 334265 files and directories currently installed.)
Preparing to unpack .../libc6_2.39-0ubuntu8_amd64.deb ...
Checking for services that may need to be restarted...
Checking init scripts...
Checking for services that may need to be restarted...
Checking init scripts...
Stopping some services possibly affected by the upgrade (will be restarted later):

dpkg-divert: error: unknown option --no-rename

Use --help for help about diverting files.
dpkg: error processing archive /var/cache/apt/archives/libc6_2.39-0ubuntu8_amd64.deb (--unpack):
new libc6:amd64 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libc6_2.39-0ubuntu8_i386.deb ...
De-configuring libc6:amd64 (2.28-0ubuntu1+zorin4) ...
dpkg-divert: error: unknown option --no-rename

Use --help for help about diverting files.
dpkg: error processing archive /var/cache/apt/archives/libc6_2.39-0ubuntu8_i386.deb (--unpack):
new libc6:i386 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.39-0ubuntu8_amd64.deb
/var/cache/apt/archives/libc6_2.39-0ubuntu8_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I wonder if using the regular Software Store updates does any difference in this case, as some of the dependencies pertain to Zorin OS exclusively. Try following the first few steps from this guide, and see if that works out:

I already tried to upgrade using this but it didn't work.
Then I tried to fix the unmet dependencies but I broke more things than I fixed.

Here is the report :
Upgrade Started
[PREPARING] Started
[PREPARING:Validating Upgrade Attempt] Started
[PREPARING:Validating Upgrade Attempt] Completed
[PREPARING:Restarting Apt] Started
[PREPARING:Restarting Apt] Completed
[PREPARING] Completed
[INSTALLING NEW APPS] Started
[INSTALLING NEW APPS:Flatpak] Started
[INSTALLING NEW APPS:Flatpak] Completed
[INSTALLING NEW APPS] Completed
[SOFTWARE CHANNELS] Started
[SOFTWARE CHANNELS:Processing Repos] Started
[SOFTWARE CHANNELS:Processing Repos] Completed
[SOFTWARE CHANNELS:Updating Apt Cache] Started
[SOFTWARE CHANNELS:Updating Apt Cache] Completed
[SOFTWARE CHANNELS] Completed
[INSTALLING UPGRADES] Started
[INSTALLING UPGRADES:Apt > Calculating Upgradeable Packages] Started
[INSTALLING UPGRADES:Apt > Calculating Upgradeable Packages] Completed
[INSTALLING UPGRADES:Apt > Committing Upgrades] Started
[INSTALLING UPGRADES:Apt > Committing Upgrades] Fatal Error: { error-not-remove-essential: Package libsemanage1 cannot be removed }
[INSTALLING UPGRADES:Apt > Committing Upgrades] Failed
[INSTALLING UPGRADES] Failed
Upgrade Failed

I could try again but the status of my OS is even worse than when I first tried to upgrade to 16.3 so I don't think it will yield anything.

Did You added any Thrid-Party Repos?

It looks like it's trying to upgrade all packages to the highest version possible from the Ubuntu repositories. However, Zorin OS 17 is based on Ubuntu 22.04 and not the latest 24.04, which seems to be causing the errors.
On my machine, libc6 is installed at version 2.35 but some of the packages that are being upgraded in your machine require it at least version 2.38:

binutils-x86-64-linux-gnu : Depends: libc6 (>= 2.38) but 2.28-0ubuntu1+zorin4 is installed

Indeed, it looks like it's trying to upgrade to the same dependencies of Ubuntu 24.04:

Preparing to unpack .../libc6_2.39-0ubuntu8_amd64.deb ...

Which matches what is offered by Ubuntu at that version.

Unfortunately, I agree. I think at this point it may be safer to make a backup of your personal data and install Zorin OS 17 using a fresh install. Personally, this is the method that I always prefer and recommend as it gives me the chance to get rid of unwanted files and whatnot, but I understand it's more tedious.

This is also a good point. Often times, adding non-official repositories to install certain software can introduce this type of issues. Although at this point there are essential packages already looking to upgrade to a higher version than what is available in Zorin OS 17 anyway.

1 Like

Here is how my update settings are :

Screenshot from 2024-10-01 16-55-50


Yeah, you can see there are a few repositories enabled that refer to Ubuntu Noble (24.04) while it should be Ubuntu Jammy (22.04). For completeness, I guess I'll also mention that Ubuntu Focal is 20.04.

Let's try to revert the changes first. Simply uncheck those repositories and run this command on the terminal sudo apt update. If everything seems okay, you can run apt list --upgradable to see what it shows this time.

2 Likes

Here is what I get after sudo apt update :
Hit:1 fr.archive.ubuntu.com / ubuntu.lafibre.info focal InRelease
Hit:2 Index of /ubuntu focal-security InRelease
Hit:3 fr.archive.ubuntu.com / ubuntu.lafibre.info focal-updates InRelease
Hit:4 fr.archive.ubuntu.com / ubuntu.lafibre.info focal-backports InRelease
Hit:5 Index of /ubuntu bionic InRelease
Hit:6 Index of /stable/ focal InRelease
Hit:7 Index of /patches/ focal InRelease
Hit:8 Index of /apps/ focal InRelease
Hit:9 Index of /drivers/ focal InRelease
Hit:10 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease
Hit:11 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease
Hit:12 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease
Hit:13 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
1899 packages can be upgraded. Run 'apt list --upgradable' to see them.

Should I try to upgrade all packages ? The list is quite long (1899 packages).

Edit : my current OS version is Zorin 15.3 Core

The moment I saw this:

it was clear that Noble or higher repositories were added.

This means that more than one package manager is running at one time. Close one of the background managers that was started in order to solve that particular roadblock.

Just to clarify, I didn't see these listed in the screenshots above:

Hit:1 fr.archive.ubuntu.com / ubuntu.lafibre.info focal InRelease
Hit:3 fr.archive.ubuntu.com / ubuntu.lafibre.info focal-updates InRelease
Hit:4 fr.archive.ubuntu.com / ubuntu.lafibre.info focal-backports InRelease

Could you just double check that "lafibre" repositories are there? They may just be the official ones (it kinda looks like it) but just to be completely sure.

I think it's normal that there are this many packages... which were the ones that have changed during previous attempts to upgrade. It's not wise to mess with this, especially going back and forth.

It might be worth considering going with the fresh install option, but before doing anything else, make sure you have backup copies of your personal files (which you should have anyway, so this is an excellent excuse to do that).

1 Like

Ok thanks for the additional info but how I close background managers ?
I restart the machine ?

Ok understood
I don't know what are these lafibre repo they don't show up in the list for upgrade setting (the 2 screenshot I sent is all the list)

Software Store
Synaptic Package Manager
or
An Open terminal running an installation or all examples of Open Package Managers.
Merely closing that application releases the lock. So, if you have Software Store open and then launch a terminal and run a sudo apt install..., closing Software Store will allow you to proceed in the terminal install.

In order to install a root package, a lock is placed securing the action to one and one authorization only. You can see how this can prevent series or parallel binders being used to install multi-access malware, such as rootkits.
So this is a good thing.
But for the user, it means that they can only have one lock at a time.

Ok, it looks like the URL points to the correct server so I think it's fine. Just wanted to double check. But, let me check something with @Aravisian:

Do you think it's safe to run the upgrade once the sources list has been fixed in this way? I was also wondering if it would be possible to simply update the focal repositories to jammy. Would that run the upgrade to Zorin OS 17 as expected?

Absolutely not. This would break everything.
If changing the sources list was all that was needed to upgrade the system to the next full release, then the Zorin Upgrader would have been released years ago.
It is actually quite complex, involving migration of packages and transition of system libraries.
A user should never try to perform a Release Upgrade by changing their sources.

It is what I would try.
The initial Release is 15.3 and with the Sources corrected to Focal, this should downgrade or correct all packages to the proper Focal versions.
Before proceeding however, you will want to double check /etc/apt/sources.list/d directory for additional third party repositories, not just /etc/apt/sources.list file if not done already.

2 Likes

I suspected that much :smiley:

@gamer388 All right, I didn't see anything unusual in the screenshots but just for good measure can you list the contents of /etc/apt/sources.list.d? If there's anything there, you can temporarily disable by either moving the file elsewhere or renaming it so that it has an extension other than list or sources.

After this, you can run sudo apt update && sudo apt upgrade. This should restore things back to normal, and then we can try to upgrade to Zorin OS 16 again (you cannot jump directly to 17, as far as I know).

Here is what I got in sources.list directory :
/etc/apt/sources.list.d$ ls -a
zorin.list
zorin.list.save
zorinos-ubuntu-drivers-bionic.list
zorinos-ubuntu-drivers-bionic.list.save
zorinos-ubuntu-patches-bionic.list
zorinos-ubuntu-patches-bionic.list.save
zorinos-ubuntu-apps-bionic.list
zorinos-ubuntu-apps-bionic.list.save
zorinos-ubuntu-stable-bionic.list
zorinos-ubuntu-stable-bionic.list.save

1 Like

That looks normal, so I think it's good to go. Good luck! :smiley: