[SOLVED] Failed to upgrade packages

john1251

Member
May 12, 2021
10
0
6
38
Hello, I ve tried to upgrade my proxmox system and encounted an error

I tried
Code:
apt update

And result is

Code:
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://ftp.debian.org/debian buster InRelease         
Hit:3 http://ftp.debian.org/debian buster-updates InRelease 
Hit:4 http://download.proxmox.com/debian/pve buster InRelease
Hit:5 http://download.proxmox.com/debian/ceph-nautilus buster InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
10 packages can be upgraded. Run 'apt list --upgradable' to see them.

Try
Code:
apt list --upgradable

Result
Code:
Listing... Done
libproxmox-acme-perl/stable 1.1.0 all [upgradable from: 1.0.8]
libpve-common-perl/stable 6.4-3 all [upgradable from: 6.4-2]
libpve-http-server-perl/stable 3.2-2 all [upgradable from: 3.2-1]
proxmox-backup-client/stable 1.1.6-2 amd64 [upgradable from: 1.1.5-1]
proxmox-backup-file-restore/stable 1.1.6-2 amd64 [upgradable from: 1.1.5-3]
proxmox-widget-toolkit/stable 2.5-4 all [upgradable from: 2.5-3]
pve-docs/stable 6.4-2 all [upgradable from: 6.4-1]
pve-firmware/stable 3.2-3 all [upgradable from: 3.2-2]
pve-kernel-5.4/stable 6.4-2 all [upgradable from: 6.4-1]
pve-manager/stable 6.4-6 amd64 [upgradable from: 6.4-5]

After that
Code:
apt upgrade

And I ve got some errors
Code:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve
The following NEW packages will be installed:
  grub-common grub-pc grub-pc-bin grub2-common idn libproxmox-acme-plugins pve-kernel-5.4.114-1-pve
The following packages will be upgraded:
  libproxmox-acme-perl libpve-common-perl libpve-http-server-perl proxmox-backup-client
  proxmox-backup-file-restore proxmox-widget-toolkit pve-docs pve-firmware pve-kernel-5.4 pve-manager
10 upgraded, 7 newly installed, 2 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 0 B/394 MB of archives.
After this operation, 190 MB disk space will be freed.
Do you want to continue? [Y/n] y
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)

Please help me to solve my issue

Thank you in advance
 
please run apt dist-upgrade
 
please run apt dist-upgrade
Code:
apt dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve
The following NEW packages will be installed:
  grub-common grub-pc grub-pc-bin grub2-common idn libproxmox-acme-plugins pve-kernel-5.4.114-1-pve
The following packages will be upgraded:
  libproxmox-acme-perl libpve-common-perl libpve-http-server-perl proxmox-backup-client
  proxmox-backup-file-restore proxmox-widget-toolkit pve-docs pve-firmware pve-kernel-5.4 pve-manager
10 upgraded, 7 newly installed, 2 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 0 B/394 MB of archives.
After this operation, 190 MB disk space will be freed.
Do you want to continue? [Y/n] y
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
what do you get from pveversion -v
 
what do you get from pveversion -v
pveversion -v proxmox-ve: not correctly installed (running kernel: 5.4.106-1-pve) pve-manager: 6.4-5 (running version: 6.4-5/6c7bf5de) ceph: 14.2.20-pve1 ceph-fuse: 14.2.20-pve1 corosync: 3.1.2-pve1 criu: 3.11-3 glusterfs-client: 5.5-3 ifupdown: 0.8.35+pve1 ksm-control-daemon: 1.3-1 libjs-extjs: 6.0.1-10 libknet1: 1.20-pve1 libproxmox-acme-perl: 1.0.8 libproxmox-backup-qemu0: 1.0.3-1 libpve-access-control: 6.4-1 libpve-apiclient-perl: 3.1-3 libpve-common-perl: 6.4-2 libpve-guest-common-perl: 3.1-5 libpve-http-server-perl: 3.2-1 libpve-storage-perl: 6.4-1 libqb0: 1.0.5-1 libspice-server1: 0.14.2-4~pve6+1 lvm2: 2.03.02-pve4 lxc-pve: 4.0.6-2 lxcfs: 4.0.6-pve1 novnc-pve: 1.1.0-1 openvswitch-switch: 2.12.3-1 proxmox-backup-client: 1.1.5-1 proxmox-mini-journalreader: 1.1-1 proxmox-widget-toolkit: 2.5-3 pve-cluster: 6.4-1 pve-container: 3.3-5 pve-docs: 6.4-1 pve-edk2-firmware: 2.20200531-1 pve-firewall: 4.1-3 pve-firmware: 3.2-2 pve-ha-manager: 3.1-1 pve-i18n: 2.3-1 pve-qemu-kvm: 5.2.0-6 pve-xtermjs: 4.7.0-3 qemu-server: 6.4-2 smartmontools: 7.2-pve2 spiceterm: 3.1-1 vncterm: 1.6-2 zfsutils-linux: 2.0.4-pve1
 
proxmox-ve: not correctly installed (running kernel: 5.4.106-1-pve)
wie hast du diesen node eingerichtet? direkt mit dem PVE installer oder auf debian mit repository?

du hast naemlich kein pve-kernel oder pve-kernel-helper paket, das sollte normalerweise nicht passieren.

kannst du bitte probieren: apt install proxmox-ve
 
wie hast du diesen node eingerichtet? direkt mit dem PVE installer oder auf debian mit repository?
I ve configured it via debian repository


kannst du bitte probieren: apt install proxmox-ve

apt install proxmox-ve Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: proxmox-archive-keyring pve-kernel-helper The following packages will be REMOVED: pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve The following NEW packages will be installed: proxmox-archive-keyring proxmox-ve pve-kernel-helper 0 upgraded, 3 newly installed, 6 to remove and 10 not upgraded. 10 not fully installed or removed. Need to get 0 B/22.4 kB of archives. After this operation, 1,666 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 75106 files and directories currently installed.) Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve /etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14. dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove): installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1 Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve /etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14. dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove): installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1 Removing pve-kernel-5.4.41-1-pve (5.4.41-1) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve update-initramfs: Deleting /boot/initrd.img-5.4.41-1-pve run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve /etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.41-1-pve.postrm line 14. dpkg: error processing package pve-kernel-5.4.41-1-pve (--remove): installed pve-kernel-5.4.41-1-pve package post-removal script subprocess returned error exit status 1 Removing pve-kernel-5.4.44-2-pve (5.4.44-2) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve update-initramfs: Deleting /boot/initrd.img-5.4.44-2-pve run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve /etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.44-2-pve.postrm line 14. dpkg: error processing package pve-kernel-5.4.44-2-pve (--remove): installed pve-kernel-5.4.44-2-pve package post-removal script subprocess returned error exit status 1 Removing pve-kernel-5.4.60-1-pve (5.4.60-2) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve update-initramfs: Deleting /boot/initrd.img-5.4.60-1-pve run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve /etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.60-1-pve.postrm line 14. dpkg: error processing package pve-kernel-5.4.60-1-pve (--remove): installed pve-kernel-5.4.60-1-pve package post-removal script subprocess returned error exit status 1 Removing pve-kernel-5.4.78-2-pve (5.4.78-2) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve update-initramfs: Deleting /boot/initrd.img-5.4.78-2-pve run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve /etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.78-2-pve.postrm line 14. dpkg: error processing package pve-kernel-5.4.78-2-pve (--remove): installed pve-kernel-5.4.78-2-pve package post-removal script subprocess returned error exit status 1 Errors were encountered while processing: pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve E: Sub-process /usr/bin/dpkg returned an error code (1)
 
(sorry for responding in german earlier :) )

I ve configured it via debian repository
looks wrong, probably you missed some steps during setup.

you are also missing: The following additional packages will be installed: proxmox-archive-keyring pve-kernel-helper

please show: (please use "[code]" tags when posting instead of "[icode]")
* find /etc/apt/ -name '*.list' -exec cat {} ';'
* apt install -f
* dpkg --configure -a
* apt full-upgrade
* apt install proxmox-ve
 
(sorry for responding in german earlier :) )


looks wrong, probably you missed some steps during setup.

you are also missing: The following additional packages will be installed: proxmox-archive-keyring pve-kernel-helper

please show: (please use "[code]" tags when posting instead of "[icode]")
* find /etc/apt/ -name '*.list' -exec cat {} ';'
* apt install -f
* dpkg --configure -a
* apt full-upgrade
* apt install proxmox-ve
find /etc/apt/ -name '*.list' -exec cat {} ';'
Code:
deb http://ftp.debian.org/debian buster main contrib
deb http://ftp.debian.org/debian buster-updates main contrib

# security updates
#deb http://security.debian.org/debian-security buster/updates main contrib





#deb http://ftp.debian.org/debian buster main contrib
#deb http://ftp.debian.org/debian buster-updates main contrib

# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve buster pve-no-subscription

# security updates
deb http://security.debian.org/debian-security buster/updates main contrib



deb http://download.proxmox.com/debian/ceph-nautilus buster main


#deb http://download.proxmox.com/debian/corosync-3/ stretch main
#deb http://download.proxmox.com/debian/ceph-nautilus buster main

apt install -f

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve
pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve
0 upgraded, 0 newly installed, 6 to remove and 10 not upgraded.
10 not fully installed or removed.
After this operation, 1,667 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.41-1-pve (5.4.41-1) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.41-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.41-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.41-1-pve (--remove):
installed pve-kernel-5.4.41-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.44-2-pve (5.4.44-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.44-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.44-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.44-2-pve (--remove):
installed pve-kernel-5.4.44-2-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.60-1-pve (5.4.60-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.60-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.60-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.60-1-pve (--remove):
installed pve-kernel-5.4.60-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.78-2-pve (5.4.78-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.78-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.78-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.78-2-pve (--remove):
installed pve-kernel-5.4.78-2-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
pve-kernel-4.15.18-12-pve
pve-kernel-4.15.18-28-pve
pve-kernel-5.4.41-1-pve
pve-kernel-5.4.44-2-pve
pve-kernel-5.4.60-1-pve
pve-kernel-5.4.78-2-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg --configure -a

Code:
dpkg --configure -a
Setting up initramfs-tools (0.133+deb10u1) ...
update-initramfs: deferring update (trigger activated)
Setting up pve-kernel-5.4.106-1-pve (5.4.106-1) ...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.4.106-1-pve /boot/vmlinuz-5.4.106-1-pve
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.4.106-1-pve /boot/vmlinuz-5.4.106-1-pve
update-initramfs: Generating /boot/initrd.img-5.4.106-1-pve
run-parts: executing /etc/kernel/postinst.d/pve-auto-removal 5.4.106-1-pve /boot/vmlinuz-5.4.106-1-pve
/etc/kernel/postinst.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postinst.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/pve-kernel-5.4.106-1-pve.postinst line 19.
dpkg: error processing package pve-kernel-5.4.106-1-pve (--configure):
 installed pve-kernel-5.4.106-1-pve package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of pve-kernel-5.4:
 pve-kernel-5.4 depends on pve-kernel-5.4.106-1-pve; however:
  Package pve-kernel-5.4.106-1-pve is not configured yet.

dpkg: error processing package pve-kernel-5.4 (--configure):
 dependency problems - leaving unconfigured
Setting up pve-kernel-5.4.65-1-pve (5.4.65-1) ...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.4.65-1-pve /boot/vmlinuz-5.4.65-1-pve
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.4.65-1-pve /boot/vmlinuz-5.4.65-1-pve
update-initramfs: Generating /boot/initrd.img-5.4.65-1-pve
run-parts: executing /etc/kernel/postinst.d/pve-auto-removal 5.4.65-1-pve /boot/vmlinuz-5.4.65-1-pve
/etc/kernel/postinst.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postinst.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/pve-kernel-5.4.65-1-pve.postinst line 19.
dpkg: error processing package pve-kernel-5.4.65-1-pve (--configure):
 installed pve-kernel-5.4.65-1-pve package post-installation script subprocess returned error exit status 2
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
update-initramfs: Generating /boot/initrd.img-5.4.106-1-pve
/etc/initramfs/post-update.d//pve-efiboot-sync: 10: /etc/initramfs/post-update.d//pve-efiboot-sync: /usr/sbin/pve-efiboot-tool: not found
run-parts: /etc/initramfs/post-update.d//pve-efiboot-sync exited with return code 127
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-5.4.106-1-pve
 pve-kernel-5.4
 pve-kernel-5.4.65-1-pve
 initramfs-tools

apt full-upgrade

Code:
apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve
The following NEW packages will be installed:
  grub-common grub-pc grub-pc-bin grub2-common idn libproxmox-acme-plugins pve-kernel-5.4.114-1-pve
The following packages will be upgraded:
  libproxmox-acme-perl libpve-common-perl libpve-http-server-perl proxmox-backup-client
  proxmox-backup-file-restore proxmox-widget-toolkit pve-docs pve-firmware pve-kernel-5.4 pve-manager
10 upgraded, 7 newly installed, 2 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 0 B/394 MB of archives.
After this operation, 190 MB disk space will be freed.
Do you want to continue? [Y/n] y
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
apt install proxmox-ve

Code:
apt install proxmox-ve
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  proxmox-archive-keyring pve-kernel-helper
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve
  pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve
The following NEW packages will be installed:
  proxmox-archive-keyring proxmox-ve pve-kernel-helper
0 upgraded, 3 newly installed, 6 to remove and 10 not upgraded.
10 not fully installed or removed.
Need to get 0 B/22.4 kB of archives.
After this operation, 1,666 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.41-1-pve (5.4.41-1) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.41-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.41-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.41-1-pve (--remove):
 installed pve-kernel-5.4.41-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.44-2-pve (5.4.44-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.44-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.44-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.44-2-pve (--remove):
 installed pve-kernel-5.4.44-2-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.60-1-pve (5.4.60-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.60-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.60-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.60-1-pve (--remove):
 installed pve-kernel-5.4.60-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.78-2-pve (5.4.78-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.78-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.78-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.78-2-pve (--remove):
 installed pve-kernel-5.4.78-2-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
 pve-kernel-5.4.41-1-pve
 pve-kernel-5.4.44-2-pve
 pve-kernel-5.4.60-1-pve
 pve-kernel-5.4.78-2-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
thanks for the outputs.
and what happens if you run apt install pve-kernel-helper?
 
you can try installing the packages that apt is trying to remove: apt install pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve

and then apt install pve-kernel-helper
 
apt install pve-kernel-helper
Code:
apt install pve-kernel-helper
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve
  pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve
The following NEW packages will be installed:
  pve-kernel-helper
0 upgraded, 1 newly installed, 6 to remove and 10 not upgraded.
10 not fully installed or removed.
Need to get 0 B/11.3 kB of archives.
After this operation, 1,667 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.41-1-pve (5.4.41-1) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.41-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.41-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.41-1-pve (--remove):
 installed pve-kernel-5.4.41-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.44-2-pve (5.4.44-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.44-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.44-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.44-2-pve (--remove):
 installed pve-kernel-5.4.44-2-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.60-1-pve (5.4.60-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.60-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.60-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.60-1-pve (--remove):
 installed pve-kernel-5.4.60-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.78-2-pve (5.4.78-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.78-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.78-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.78-2-pve (--remove):
 installed pve-kernel-5.4.78-2-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
 pve-kernel-5.4.41-1-pve
 pve-kernel-5.4.44-2-pve
 pve-kernel-5.4.60-1-pve
 pve-kernel-5.4.78-2-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
apt install pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve
Code:
apt install pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve
Reading package lists... Done
Building dependency tree       
Reading state information... Done
pve-kernel-5.4.41-1-pve is already the newest version (5.4.41-1).
pve-kernel-5.4.44-2-pve is already the newest version (5.4.44-2).
pve-kernel-5.4.60-1-pve is already the newest version (5.4.60-2).
pve-kernel-5.4.78-2-pve is already the newest version (5.4.78-2).
pve-kernel-4.15.18-12-pve is already the newest version (4.15.18-36).
pve-kernel-4.15.18-28-pve is already the newest version (4.15.18-56).
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve
0 upgraded, 0 newly installed, 2 to remove and 10 not upgraded.
10 not fully installed or removed.
Need to get 0 B/241 MB of archives.
After this operation, 517 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)
apt install pve-kernel-helper
Code:
apt install pve-kernel-helper
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  pve-kernel-4.15.18-12-pve pve-kernel-4.15.18-28-pve pve-kernel-5.4.41-1-pve
  pve-kernel-5.4.44-2-pve pve-kernel-5.4.60-1-pve pve-kernel-5.4.78-2-pve
The following NEW packages will be installed:
  pve-kernel-helper
0 upgraded, 1 newly installed, 6 to remove and 10 not upgraded.
10 not fully installed or removed.
Need to get 0 B/11.3 kB of archives.
After this operation, 1,667 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 75106 files and directories currently installed.)
Removing pve-kernel-4.15.18-12-pve (4.15.18-36) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-12-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-12-pve /boot/vmlinuz-4.15.18-12-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-12-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-12-pve (--remove):
 installed pve-kernel-4.15.18-12-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-4.15.18-28-pve (4.15.18-56) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
update-initramfs: Deleting /boot/initrd.img-4.15.18-28-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 4.15.18-28-pve /boot/vmlinuz-4.15.18-28-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-4.15.18-28-pve.postrm line 14.
dpkg: error processing package pve-kernel-4.15.18-28-pve (--remove):
 installed pve-kernel-4.15.18-28-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.41-1-pve (5.4.41-1) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.41-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.41-1-pve /boot/vmlinuz-5.4.41-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.41-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.41-1-pve (--remove):
 installed pve-kernel-5.4.41-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.44-2-pve (5.4.44-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.44-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.44-2-pve /boot/vmlinuz-5.4.44-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.44-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.44-2-pve (--remove):
 installed pve-kernel-5.4.44-2-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.60-1-pve (5.4.60-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
update-initramfs: Deleting /boot/initrd.img-5.4.60-1-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.60-1-pve /boot/vmlinuz-5.4.60-1-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.60-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.60-1-pve (--remove):
 installed pve-kernel-5.4.60-1-pve package post-removal script subprocess returned error exit status 1
Removing pve-kernel-5.4.78-2-pve (5.4.78-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
update-initramfs: Deleting /boot/initrd.img-5.4.78-2-pve
run-parts: executing /etc/kernel/postrm.d/pve-auto-removal 5.4.78-2-pve /boot/vmlinuz-5.4.78-2-pve
/etc/kernel/postrm.d/pve-auto-removal: 4: .: Can't open /usr/share/pve-kernel-helper/scripts/functions
run-parts: /etc/kernel/postrm.d/pve-auto-removal exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.4.78-2-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.4.78-2-pve (--remove):
 installed pve-kernel-5.4.78-2-pve package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 pve-kernel-4.15.18-12-pve
 pve-kernel-4.15.18-28-pve
 pve-kernel-5.4.41-1-pve
 pve-kernel-5.4.44-2-pve
 pve-kernel-5.4.60-1-pve
 pve-kernel-5.4.78-2-pve
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
I ve solved this issie

A few articles helps
https://askubuntu.com/questions/203...tc-kernel-postrm-d-zz-update-grub-exited-with

I ve just rename all files in /etc/kernel/postrm.d/

initramfs-tools - > initramfs-tools.bak
proxmox-auto-removal - > proxmox-auto-removal.bak
zz-proxmox-boot - > zz-proxmox-boot.bak
zz-update-grub - > zz-update-grub.bak

then:

dpkg --list | grep pve-kernel

Code:
ii  pve-firmware                         3.2-3                                        all          Binary firmware code for the pve-kernel
ii  pve-kernel-5.4.106-1-pve             5.4.106-1                                    amd64        The Proxmox PVE Kernel Image
ii  pve-kernel-5.4.114-1-pve             5.4.114-1                                    amd64        The Proxmox PVE Kernel Image
ii  pve-kernel-5.4.65-1-pve              5.4.65-1                                     amd64        The Proxmox PVE Kernel Image

(some lines are missed, because i ve delete it)

And delete old kernels:

dpkg --purge pve-kernel-4.15.18-12-pve dpkg --purge pve-kernel-4.15.18-28-pve

apt update apt purge grub-common apt install grub-pc apt upgrade

And there are no errors)))

Rename files in /etc/kernel/postrm.d/ backward
initramfs-tools.bak - > initramfs-tools
proxmox-auto-removal.bak - > proxmox-auto-removal
zz-proxmox-boot.bak - > zz-proxmox-boot
zz-update-grub.bak - > zz-update-grub

apt update - no errors

apt install pve-kernel-helper apt install pve-manager
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!