Score:0

dependency problems prevent removal of linux-image

us flag

recently my linux updated the kernel on its own, and because of this my boot out of memory, I am trying to remove the old linux kernel versions: 6.2.0 and 5.19.0.45

saba@saba:~$ dpkg --list | grep linux-image
pi  linux-image-5.19.0-45-generic              5.19.0-45.46~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-5.19.0-46-generic              5.19.0-46.47~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-5.19.0-50-generic              5.19.0-50.50                            amd64        Signed kernel image generic
pi  linux-image-6.2.0-26-generic               6.2.0-26.26~22.04.1                     amd64        Signed kernel image generic

I am attempting the removal with Mainline Kernels app (I've tried manually too but same thing)

but it displays following error:

mainline 1.4.8
uninstall 6.2.0-26.26~22.04.1 
Uninstalling 6.2.0-26.26~22.04.1                                      
dpkg: dependency problems prevent removal of linux-image-6.2.0-26-generic:
 linux-signatures-nvidia-6.2.0-26-generic depends on linux-image-6.2.0-26-generic | linux-image-unsigned-6.2.0-26-generic; however:
  Package linux-image-6.2.0-26-generic is to be removed.
  Package linux-image-unsigned-6.2.0-26-generic is not installed.
 linux-modules-nvidia-525-6.2.0-26-generic depends on linux-image-6.2.0-26-generic | linux-image-unsigned-6.2.0-26-generic; however:
  Package linux-image-6.2.0-26-generic is to be removed.
  Package linux-image-unsigned-6.2.0-26-generic is not installed.

dpkg: error processing package linux-image-6.2.0-26-generic (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of linux-modules-6.2.0-26-generic:
 linux-image-6.2.0-26-generic depends on linux-modules-6.2.0-26-generic.

dpkg: error processing package linux-modules-6.2.0-26-generic (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 linux-image-6.2.0-26-generic
 linux-modules-6.2.0-26-generic
mainline: done

same error, no matter the kernel version.

when i try to remove it manually i do this:

sudo apt-get --purge remove linux-image-6.2.0-26-generic

and got this at the end of the logs

/var/lib/dpkg/info/linux-image-6.2.0-26-generic.postrm ... removing pending trigger
rmdir: failed to remove '/lib/modules/6.2.0-26-generic': Directory not empty
Processing triggers for linux-image-unsigned-6.2.0-26-generic (6.2.0-26.26~22.04.1) ...
dpkg --list | head -n 4
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                       Version                                 Architecture Description

so how do I remove them? and why is it even happening?

Artur Meinild avatar
vn flag
Which command are you running to remove the kernel? Please include this in your post.
Hannu avatar
ca flag
Please also note the (first three lines of the) header shown by `$ dpkg --list | head -n 4`
Saba avatar
us flag
@ArturMeinild updated.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.