Problems removing old Kernel 6

KLez

Active Member
Mar 7, 2020
24
12
43
45
Hello.

I have some problems uninstalling an old kenel package
proxmox-kernel-6.17.13-13-pve-signed

apt autoremove shows this:

Bash:
root@pve:/# apt autoremove
REMOVING:                      
  proxmox-kernel-6.17.13-13-pve-signed

Summary:
  Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
  1 not fully installed or removed.
  Freed space: 991 MB

Continue? [Y/n] y
(Reading database ... 76330 files and directories currently installed.)
Removing proxmox-kernel-6.17.13-13-pve-signed (6.17.13-13) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
update-initramfs: Deleting /boot/initrd.img-6.17.13-13-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
run-parts: /etc/kernel/postrm.d/zz-proxmox-boot exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/proxmox-kernel-6.17.13-13-pve-signed.postrm line 15.
dpkg: error processing package proxmox-kernel-6.17.13-13-pve-signed (--remove):
 installed proxmox-kernel-6.17.13-13-pve-signed package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 proxmox-kernel-6.17.13-13-pve-signed
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg -P proxmox-kernel-6.17.13-13-pve-signed
and
apt remove proxmox-kernel-6.17.13-13-pve-signed
does not work.
Trying to reinstall the package and remove it afterwards does not work too.
What can i do?
 
I can't properly test this right now but does something like this show more info?
Bash:
bash -x /etc/kernel/postrm.d/zz-proxmox-boot 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
apt autoremove -o Dpkg::Options::="--debug=10002"
 
unfortunately this had no effect :(
This is the output of your first command:

Code:
root@pve:~# bash -x /etc/kernel/postrm.d/zz-proxmox-boot 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
+ set -e
+ command -V systemd-detect-virt
+ systemd-detect-virt --quiet --container
+ trap cleanup EXIT INT TERM QUIT
+ . /usr/share/proxmox-kernel-helper/scripts/functions
++ set -e
++ ESP_LIST=/etc/kernel/proxmox-boot-uuids
++ ESPTYPE=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
++ MANUAL_KERNEL_LIST=/etc/kernel/proxmox-boot-manual-kernels
++ PINNED_KERNEL_CONF=/etc/kernel/proxmox-boot-pin
++ NEXT_BOOT_PIN=/etc/kernel/next-boot-pin
++ MOUNTROOT=/var/tmp/espmounts
++ PMX_ESP_DIR=EFI/proxmox
++ PMX_LOADER_CONF=loader/loader.conf
++ GRUB_PIN_SNIPPET=/etc/default/grub.d/proxmox-kernel-pin.cfg
+ LOADER_TITLE='Proxmox Virtual Environment'
+ '[' -d /etc/pve/ ']'
+ LOADER_TITLE='Proxmox Virtual Environment'
+ set --
+ mode=
+ mode=
+ case $0:$mode in
+ reexec_in_mountns
+ '[' -z '' ']'
+ export PVE_EFIBOOT_UNSHARED=1
+ PVE_EFIBOOT_UNSHARED=1
+ echo 'Re-executing '\''/etc/kernel/postrm.d/zz-proxmox-boot'\'' in new private mount namespace..'
Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot' in new private mount namespace..
+ unshare --mount --propagation private /etc/kernel/postrm.d/zz-proxmox-boot
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
+ cleanup
+ for mount in "${MOUNTROOT}"/*
+ echo '/var/tmp/espmounts/*'
+ grep -qE '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'
root@pve:~#

And here from the second:

Code:
root@pve:~# apt autoremove -o Dpkg::Options::="--debug=10002"
REMOVING:                      
  proxmox-kernel-6.17.13-13-pve-signed

Summary:
  Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
  1 not fully installed or removed.
  Freed space: 991 MB

Continue? [Y/n] y
(Reading database ... 76330 files and directories currently installed.)
Removing proxmox-kernel-6.17.13-13-pve-signed (6.17.13-13) ...
D000002: fork/exec /var/lib/dpkg/info/proxmox-kernel-6.17.13-13-pve-signed.postrm ( remove )
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
update-initramfs: Deleting /boot/initrd.img-6.17.13-13-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 6.17.13-13-pve /boot/vmlinuz-6.17.13-13-pve
Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
run-parts: /etc/kernel/postrm.d/zz-proxmox-boot exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/proxmox-kernel-6.17.13-13-pve-signed.postrm line 15.
dpkg: error processing package proxmox-kernel-6.17.13-13-pve-signed (--remove):
 installed proxmox-kernel-6.17.13-13-pve-signed package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
D010000: trigproc_run_deferred
Errors were encountered while processing:
 proxmox-kernel-6.17.13-13-pve-signed
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)
root@pve:~#
 
Hi @KLez,
can you share the output of cat /etc/kernel/postrm.d/zz-proxmox-boot?