I broke APT - Removing old Kernel [solved-reinstalled clone]

Archived topics about LMDE 1 and LMDE 2
Locked
GeneC

I broke APT - Removing old Kernel [solved-reinstalled clone]

Post by GeneC »

I was routinely deleting an old unsed kernel today, and ran into this problem.
Aan error occured, here are the details.

Error message when using Synaptic

Image

Now, I cant do anything with Synaptic, such as adding new stuff or upgrading.
All I get is this same error message about the error encountered when trying to remove the Liquorix kernel.


Looks like I broke apt ?

Code: Select all

gene@zordon ~ $ sudo apt-get update && sudo apt-get dist-upgrade
[sudo] password for gene: 
....................................
........................................
 
Fetched 45.8 kB in 8s (5,709 B/s)                                              
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-3.0-3.dmz.1-liquorix-amd64
The following NEW packages will be installed:
  libavformat53 libswscale2
The following packages have been kept back:
  ..............................
0 upgraded, 2 newly installed, 1 to remove and 36 not upgraded.
1 not fully installed or removed.
Need to get 0 B/555 kB of archives.
After this operation, 136 MB disk space will be freed.
Do you want to continue [Y/n]? y

(Reading database ... 181461 files and directories currently installed.)
Removing linux-image-3.0-3.dmz.1-liquorix-amd64 ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0-3.dmz.1-liquorix-amd64 /boot/vmlinuz-3.0-3.dmz.1-liquorix-amd64
update-initramfs: Deleting /boot/initrd.img-3.0-3.dmz.1-liquorix-amd64
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0-3.dmz.1-liquorix-amd64 /boot/vmlinuz-3.0-3.dmz.1-liquorix-amd64
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0-4.dmz.1-liquorix-amd64...
E: /usr/share/syslinux/debian/extlinux: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.0-3.dmz.1-liquorix-amd64.postrm line 235.
dpkg: error processing linux-image-3.0-3.dmz.1-liquorix-amd64 (--remove):
 subprocess installed post-removal script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 linux-image-3.0-3.dmz.1-liquorix-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
gene@zordon ~ $ 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Gerd50

Re: I broke APT - Removing old Kernel

Post by Gerd50 »

Hello Gene,

here

http://forums.linuxmint.com/viewtopic.php?f=141&t=80555

another kernel problem with the same result as yours, synaptic not working. I didn't really believe booting the recovery mode
and run update/dist-upgrade would help, but it did. Maybe it could be a solution for you too?
GeneC

Re: I broke APT - Removing old Kernel

Post by GeneC »

Hi Gerd50

Thanks for the help. Didn't work.


My problem is a bit different that the one mentioned.
He didn't get a proper upgrade to a kernel

I got mine fine. It was just when removing (or trying to) :shock:
The OLD kernel that something happened.
It appears it only partially did the job.

Running synaptic from CLI
gene@zordon ~ $ sudo synaptic
[sudo] password for gene:
/usr/bin/deborphan: The status file is in an improper state.
One or more packages are marked as half-installed, half-configured,
unpacked, triggers-awaited or triggers-pending. Exiting.
For lack of knowing what else to do.
I tried

Code: Select all

sudo dpkg --configure -a
and

Code: Select all

sudo update-initramfs -u && sudo update-grub
Still broke!
GeneC

Re: I broke APT - Removing old Kernel

Post by GeneC »

gene@zordon ~ $ sudo apt-get remove linux-image-3.0-3.dmz.1-liquorix-amd64
[sudo] password for gene:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-3.0-3.dmz.1-liquorix-amd64
0 upgraded, 0 newly installed, 1 to remove and 38 not upgraded.
1 not fully installed or removed.
After this operation, 138 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 181461 files and directories currently installed.)
Removing linux-image-3.0-3.dmz.1-liquorix-amd64 ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.0-3.dmz.1-liquorix-amd64 /boot/vmlinuz-3.0-3.dmz.1-liquorix-amd64
update-initramfs: Deleting /boot/initrd.img-3.0-3.dmz.1-liquorix-amd64
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.0-3.dmz.1-liquorix-amd64 /boot/vmlinuz-3.0-3.dmz.1-liquorix-amd64
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.0-4.dmz.1-liquorix-amd64...
E: /usr/share/syslinux/debian/extlinux: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-extlinux exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.0-3.dmz.1-liquorix-amd64.postrm line 235.
dpkg: error processing linux-image-3.0-3.dmz.1-liquorix-amd64 (--remove):
subprocess installed post-removal script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
linux-image-3.0-3.dmz.1-liquorix-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

gene@zordon ~ $

Line 232-246 of
/var/lib/dpkg/info/linux-image-3.0-3.dmz.1-liquorix-amd64.postrm
}
if (-d "/etc/kernel/postrm.d") {
warn "Examining /etc/kernel/postrm.d .\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/postrm.d") &&
die "Failed to process /etc/kernel/postrm.d";
}
if (-d "/etc/kernel/postrm.d/$version") {
warn "Examining /etc/kernel/postrm.d/$version .\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/postrm.d/$version") &&
die "Failed to process /etc/kernel/postrm.d/$version";
}
This is GREEK to me..
Maybe I'll just try deleting that section and trying again.
OR reloading a 3 week old clone, and updating.... :roll:
GeneC

Re: I broke APT - Removing old Kernel

Post by GeneC »

PHOOEY!

Tired of trying to fix this.
Its been a long day. Several problems today.
Frustrated and taking the easy way out, and restoring old clone.

Time for a BEER OR TWO! :twisted:
sumski

Re: I broke APT - Removing old Kernel

Post by sumski »

do this:

Code: Select all

sudo chmod -x /etc/kernel/postrm.d/zz-extlinux
then do

Code: Select all

sudo dpkg --configure -a

Code: Select all

sudo apt-get dist-upgrade
Gerd50

Re: I broke APT - Removing old Kernel

Post by Gerd50 »

Hi Gene,

While a lot happened here i was thinking about the deborphan thing and found this

http://www.linuxjournal.com/content/tec ... an-systems

After a 'sudo deborphan' i installed gtkorphan and find it very interesting.
secipolla

Re: I broke APT - Removing old Kernel

Post by secipolla »

GeneC

Re: I broke APT - Removing old Kernel

Post by GeneC »

sumski, Gerd50, and secipolla

Thanks much for the help.
Quite interesting stuff.

Unfortunately, I had signed off the forum, and re-installed a couple week old clone, so I cannot try your suggestions.
I should have waited a while longer, but got a bit "burnt-out".
I had edited several files, that I probably should not have in an attempt to fix things, and probably messed things up beyond repair.

I have bookmarked this thread, and it may be of use if (when?) I mess up again. :wink:

It will help others as well.

sumski,
I wish I had waited and tried those commands.

Gerd50.
Funny you should mention deborphan! I tried it , and it found nothing.

secipolla
I looked at the reference you gave. That is another bookmark. Good Stuff.

Thanks, all!
Locked

Return to “LMDE Archive”