"The package system is broken"

Hello

Hoping someone can help here. My ability to update my system or install any programs has been halted, as my Software Updater says:

image

Terminal gives the following error:

**sudo apt 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.
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

That command doesn't succeed:

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:
  linux-image-unsigned-5.15.0-78-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools linux-headers-5.15.0-78-generic
  linux-modules-extra-5.15.0-78-generic
The following packages will be REMOVED
  linux-image-5.15.0-78-generic
The following NEW packages will be installed
  linux-image-unsigned-5.15.0-78-generic
0 to upgrade, 1 to newly install, 1 to remove and 44 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 561 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-78-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.15.0-78-generic depends on linux-image-5.15.0-78-generic | linux-image-unsigned-5.15.0-78-generic; ho
wever:
  Package linux-image-5.15.0-78-generic is to be removed.
  Package linux-image-unsigned-5.15.0-78-generic is not installed.

(Reading database ... 296542 files and directories currently installed.)
Removing linux-image-5.15.0-78-generic (5.15.0-78.85~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-78-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-78-generic (--remove):
 installed linux-image-5.15.0-78-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-78-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried all sorts of solutions that I've found online, including the following, but nothing works:

sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  linux-image-unsigned-5.15.0-78-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools
  linux-headers-5.15.0-78-generic linux-modules-extra-5.15.0-78-generic
The following packages will be REMOVED
  linux-image-5.15.0-78-generic
The following NEW packages will be installed
  linux-image-unsigned-5.15.0-78-generic
0 to upgrade, 1 to newly install, 1 to remove and 46 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 561 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-78-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.15.0-78-generic depends on linux-image-5.15.0-78-generic | linux-image-unsigned-5.15.0-78-generic; however:
  Package linux-image-5.15.0-78-generic is to be removed.
  Package linux-image-unsigned-5.15.0-78-generic is not installed.

(Reading database ... 296542 files and directories currently installed.)
Removing linux-image-5.15.0-78-generic (5.15.0-78.85~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-78-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-78-generic (--remove):
 installed linux-image-5.15.0-78-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-78-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

An impression I have got, is that I may need to manually remove this file, but I am very apprehensive about trying this, as my Linux knowledge is still quite amateur:

linux-image-5.15.0-78-generic

If this is something I can try, please tell me how in your reply (I believe it may be sudo apt remove linux-image-5.15.0-78-generic?

PS I have tried turning it off and on again :laughing:

Thanks a lot.

It appears you are having trouble with a kernel installation. The only cause I can see for this is if there is an additional repository added to your system that is also trying to supply an Unsigned Kernel
Or
That Secure Boot was enabled in your BIOS /EFI settings at time of Zorin OS Install.

Can you please check both?
In your motherboard BIOS settings; check the status of Secure Boot. Enabled or disabled?

In your Zorin OS, please launch a terminal and run

sudo apt update

and post the results here using the </> icon in your post toolbar to wrap that pasted text in order to no-parse it.

2 Likes

Thanks a lot for the reply. I actually solved this before seeing your fix:

sudo apt reinstall linux-image-5.15.0-78-generic

Out of interest, what do you mean by "if there is an additional repository added to your system that is also trying to supply an Unsigned Kernel"?

My answer will cover Hypothetical situations in which a person could have this happen.
Let's say that a Zorin OS user wants a package that is developed by the Pop_OS team. They add the Pop_OS repo and install the package... But they forget to remove the repository after installing the wanted package.
This is true for if you wanted a package from the LinuxMint team.

Or if a person installed a repository for a Later Version of Kernel such as outlined here:

(The above only contains Unsigned Kernels).

If the user then Updates/Upgrades the system, it will try to pull from that added repository, including the later kernel, even if it is a different kernel than the vetted released Zorin OS Kernel.

Hope this helps and I have marked your post as the solution to the thread.

Hey

I'm actually still seeing issues :frowning:

sudo apt update

Hit:1 http://gb.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                                           
Get:3 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]                                         
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                            
Get:5 https://deb.nodesource.com/node_16.x focal InRelease [4,583 B]          
Hit:6 https://brave-browser-apt-release.s3.brave.com stable InRelease                       
Get:7 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [274 kB]
Get:8 http://gb.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [415 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:10 http://gb.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,976 B]
Get:11 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [59.7 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [96.6 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
Fetched 1,226 kB in 1s (957 kB/s)                                         
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up-to-date.

...this looks ok, but if I try to install something:

sudo apt install synaptic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
synaptic is already the newest version (0.84.6ubuntu5).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
linux-modules-5.15.0-84-generic : Depends: linux-image-5.15.0-84-generic but it is not going to be installed or
                                           linux-image-unsigned-5.15.0-84-generic but it is not going to be 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... Done
The following package was automatically installed and is no longer required:
  linux-hwe-5.15-headers-5.15.0-84
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  linux-image-unsigned-5.15.0-84-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools linux-headers-5.15.0-84-generic
  linux-modules-extra-5.15.0-84-generic
The following packages will be REMOVED
  linux-image-5.15.0-84-generic
The following NEW packages will be installed
  linux-image-unsigned-5.15.0-84-generic
0 to upgrade, 1 to newly install, 1 to remove and 0 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 610 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-84-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.15.0-84-generic depends on linux-image-5.15.0-84-generic | linux-image-unsigned-5.15.0-84-generic; however:
  Package linux-image-5.15.0-84-generic is to be removed.
  Package linux-image-unsigned-5.15.0-84-generic is not installed.

(Reading database ... 318411 files and directories currently installed.)
Removing linux-image-5.15.0-84-generic (5.15.0-84.93~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-84-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-84-generic (--remove):
 installed linux-image-5.15.0-84-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-84-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any ideas, please?

I agree. That does look ok.
Can you please launch Software & Updates from your app menu.
On the first tab, check that all four top boxes are Checked.
Ensure that the last fifth box for Source Code is unchecked.

Under "Download From" set the drop down menu to "Main Server". Move to the "Other Software" tab and ensure that CDROM: Zorin OS... is unchecked.

Close the app and click "OK" or "Yes" on the prompt to reload sources.
In terminal, please run:

sudo apt --fix-missing update

sudo dpkg --configure -a

sudo apt update

sudo apt --fix-broken install

If all goes well and no errors; test installing Synaptic and see if it goes wrong, again...

Ok I have done all of that (please note that I couldn't see an option to uncheck the CDROM option - see screenshot below), but I am seeing fails on sudo dpkg --configure -a and sudo apt --fix-broken install:

sudo apt --fix-missing update    
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-security InRelease
Get:5 https://deb.nodesource.com/node_16.x focal InRelease [4,583 B]
Hit:6 https://brave-browser-apt-release.s3.brave.com stable InRelease
Fetched 4,583 B in 1s (4,537 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up-to-date.
sudo dpkg --configure -a
Setting up linux-image-5.15.0-86-generic (5.15.0-86.96~20.04.1) ...
Processing triggers for linux-image-5.15.0-86-generic (5.15.0-86.96~20.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-86-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-86-generic (--configure):
 installed linux-image-5.15.0-86-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-5.15.0-86-generic
sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                       
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease                                                     
Hit:4 http://archive.ubuntu.com/ubuntu focal-security InRelease                              
Get:5 https://deb.nodesource.com/node_16.x focal InRelease [4,583 B]                         
Hit:6 https://brave-browser-apt-release.s3.brave.com stable InRelease                        
Fetched 4,583 B in 1s (4,365 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up-to-date.
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  linux-hwe-5.15-headers-5.15.0-84
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  linux-image-unsigned-5.15.0-84-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools linux-headers-5.15.0-84-generic
  linux-modules-extra-5.15.0-84-generic
The following packages will be REMOVED
  linux-image-5.15.0-84-generic
The following NEW packages will be installed
  linux-image-unsigned-5.15.0-84-generic
0 to upgrade, 1 to newly install, 1 to remove and 0 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 610 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-84-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.15.0-84-generic depends on linux-image-5.15.0-84-generic | linux-image-unsigned-5.15.0-84-generic; ho
wever:
  Package linux-image-5.15.0-84-generic is to be removed.
  Package linux-image-unsigned-5.15.0-84-generic is not installed.

(Reading database ... 318411 files and directories currently installed.)
Removing linux-image-5.15.0-84-generic (5.15.0-84.93~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-84-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-84-generic (--remove):
 installed linux-image-5.15.0-84-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-84-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

:hot_face:

The next steps will need to be to

sudo rm /var/lib/dpkg/info/linux-image-5.15.0-84-generic.postinst

sudo rm /var/lib/dpkg/info/linux-image-unsigned-5.15.0-84-generic.postinst

sudo apt --fix-broken install

sudo apt autoremove && sudo apt clean

Do Not Reboot at this time.
Test if you can install synaptic. If you can (let it install) and then immediately run

sudo apt install linux-image-5.15.0-83-generic linux-headers-5.15.0-83-generic linux-modules-5.15.0-83-generic linux-modules-extra-5.15.0-83-generic

The purpose of the last command is to ensure that you have a known, good, working kernel installed, just in case.

I need to step away so it may be a while before I reply - another helpful member might step in to help.

No problem.

Unfortunately, I'm still seeing the same issue at the sudo apt --fix-broken install stage:

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  linux-hwe-5.15-headers-5.15.0-84
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  linux-image-unsigned-5.15.0-84-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools linux-headers-5.15.0-84-generic
  linux-modules-extra-5.15.0-84-generic
The following packages will be REMOVED
  linux-image-5.15.0-84-generic
The following NEW packages will be installed
  linux-image-unsigned-5.15.0-84-generic
0 to upgrade, 1 to newly install, 1 to remove and 0 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 610 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-84-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.15.0-84-generic depends on linux-image-5.15.0-84-generic | linux-image-unsigned-5.15.0-84-generic; ho
wever:
  Package linux-image-5.15.0-84-generic is to be removed.
  Package linux-image-unsigned-5.15.0-84-generic is not installed.

(Reading database ... 318411 files and directories currently installed.)
Removing linux-image-5.15.0-84-generic (5.15.0-84.93~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-84-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-84-generic (--remove):
 installed linux-image-5.15.0-84-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-84-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Let's try forcing the install:

sudo apt install -f linux-image-unsigned-5.15.0-84-generic

sudo apt install -f linux-image-unsigned-5.15.0-84-generic    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-hwe-5.15-headers-5.15.0-84
Use 'sudo apt autoremove' to remove it.
Suggested packages:
  fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools linux-headers-5.15.0-84-generic
  linux-modules-extra-5.15.0-84-generic
The following packages will be REMOVED
  linux-image-5.15.0-84-generic
The following NEW packages will be installed
  linux-image-unsigned-5.15.0-84-generic
0 to upgrade, 1 to newly install, 1 to remove and 0 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/11.6 MB of archives.
After this operation, 610 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.15.0-84-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.15.0-84-generic depends on linux-image-5.15.0-84-generic | linux-image-unsigned-5.15.0-84-generic; however:
  Package linux-image-5.15.0-84-generic is to be removed.
  Package linux-image-unsigned-5.15.0-84-generic is not installed.

(Reading database ... 318411 files and directories currently installed.)
Removing linux-image-5.15.0-84-generic (5.15.0-84.93~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-84-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.15.0-84-generic (--remove):
 installed linux-image-5.15.0-84-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-84-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I really do have quite a knack for breaking things.

lol, I am glad you are staying in good spirits.

I am honestly baffled. Given your repositories and given all you have shown, I simply am at a total loss as to why your package manager is obsessed with the unsigned kernel.

-sigh-

How would you feel about backing up all personal data and performing a reinstall of Zorin OS?

Haha.

Reinstall...I wouldn't be over the moon about it, as I have things laid out how I like them, etc. I seem to recall having a few teething issues too (I think setting Nord VPN up caused me some hassle) post-install.

It's not the end of the world, but is there anything else I can try before I do that :laughing:

Thanks very much for all your help!

Yes, I can see how this would make you hesitate.

This is what I have been trying... I have reached the end.

What we can do is not rush (if you are not feeling a need for a package install right away) and see if another forum member is able to help where I failed.
Or continue searching the web to see if a clue points us in a direction toward a fix.

Yep I'd prefer to wait a little longer to see if there are any other suggestions from anyone. Nord isn't the only thing I recall having issues with (I know my printer was a pain and there were other things I can't recall, but took me hours to sort out), so a reinstall is not something I have time for right now really.

Does Timeshift back up your settings? I have a backup in that, but don't overly know what it is taking care of.

1 Like

That is worth trying, sure. If you are confident of not losing anything important and the date at which the trouble began.

Hey

I spent a few hours last night reinstalling and getting everything back to how it was. The biggest proportion of my time was spent trying to set up Nord using the wrong email address haha. Besides that, it was a breeze.

I thank you again for your help. At least I know in future that any issues, the worst case scenario is I reinstall again.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.