Solved - Failing apt upgrades

rogueangel2k

New Member
Dec 18, 2023
6
1
3
Sometime back I ran a routine update. apt update... then apt dist-upgrade

One host upgraded, rebooted, and came back online fine.
2nd identical host upgraded, rebooted, dropped to single user mode and would not mount a USB drive correctly.

Long story short, I forced grub to boot the older kernel, and that's where it sits now. Boots fine, mounts USB drive correctly, guests come online.

All subsequent updates have failed. See below:

root@leo2:~# apt update
Hit:1 http://ftp.debian.org/debian bullseye InRelease
Hit:2 http://security.debian.org/debian-security bullseye-security InRelease
Hit:3 http://ftp.debian.org/debian bullseye-updates InRelease
Hit:4 http://download.proxmox.com/debian/pve bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

root@leo2:~# apt dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/76.8 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up initramfs-tools (0.140) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.140) ...
update-initramfs: Generating /boot/initrd.img-5.15.126-1-pve
/etc/initramfs/post-update.d//proxmox-boot-sync: 10: /usr/sbin/proxmox-boot-tool: not found
run-parts: /etc/initramfs/post-update.d//proxmox-boot-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:
initramfs-tools
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@leo2:~# uname -a
Linux leo2 5.15.126-1-pve #1 SMP PVE 5.15.126-1 (2023-10-03T17:24Z) x86_64 GNU/Linux

I'm lost. Please point me in the right direction.
 
Last edited:
Hi,
it looks like you had a failed installation before:

Could you try to run apt --fix-broken install and post the output if it fails?
root@leo2:~# apt install --fix-broken
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
pve-kernel-5.15.107-1-pve
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 400 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 100981 files and directories currently installed.)
Removing pve-kernel-5.15.107-1-pve (5.15.107-1) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.107-1-pve /boot/vmlinuz-5.15.107-1-pve
update-initramfs: Deleting /boot/initrd.img-5.15.107-1-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 5.15.107-1-pve /boot/vmlinuz-5.15.107-1-pve
/etc/kernel/postrm.d/proxmox-auto-removal: 4: .: cannot open /usr/share/proxmox-kernel-helper/scripts/functions: No such file
run-parts: /etc/kernel/postrm.d/proxmox-auto-removal exited with return code 2
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.15.107-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.15.107-1-pve (--remove):
installed pve-kernel-5.15.107-1-pve package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
pve-kernel-5.15.107-1-pve
Processing was halted because there were too many errors.
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
Both failures hint to a partial installation of proxmox-kernel-helper, please try reinstalling it:
Bash:
apt --reinstall install proxmox-kernel-helper
 
Both failures hint to a partial installation of proxmox-kernel-helper, please try reinstalling it:
Bash:
apt --reinstall install proxmox-kernel-helper
root@leo2:~# apt --reinstall install proxmox-kernel-helper
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
pve-kernel-5.15.107-1-pve
The following NEW packages will be installed:
proxmox-kernel-helper
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 15.3 kB of archives.
After this operation, 400 MB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://download.proxmox.com/debian/pve bullseye/pve-no-subscription amd64 proxmox-kernel-helper all 7.4-1 [15.3 kB]
Fetched 15.3 kB in 0s (44.2 kB/s)
(Reading database ... 100981 files and directories currently installed.)
Removing pve-kernel-5.15.107-1-pve (5.15.107-1) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.107-1-pve /boot/vmlinuz-5.15.107-1-pve
update-initramfs: Deleting /boot/initrd.img-5.15.107-1-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 5.15.107-1-pve /boot/vmlinuz-5.15.107-1-pve
/etc/kernel/postrm.d/proxmox-auto-removal: 4: .: cannot open /usr/share/proxmox-kernel-helper/scripts/functions: No such file
run-parts: /etc/kernel/postrm.d/proxmox-auto-removal exited with return code 2
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/pve-kernel-5.15.107-1-pve.postrm line 14.
dpkg: error processing package pve-kernel-5.15.107-1-pve (--remove):
installed pve-kernel-5.15.107-1-pve package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
pve-kernel-5.15.107-1-pve
Processing was halted because there were too many errors.
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
To add to this. After this last failure I noticed and ran this

apt --reinstall install pve-kernel-5.15.107-1-pve

Then ran apt --reinstall install proxmox-kernel-helper again and it installed.
 
Ran pve7to8 and a failure of "FAIL: proxmox-ve package is too old, please upgrade to >= 7.4-1!" was experienced. Ran "
apt --reinstall install proxmox-ve" and now no failures.

I will reboot again and make sure the current kernel boots and report back later on.

Thank you for getting me on track. I was going cross-eyed looking at this and banging my head.
 
That did it. She booted.

Kernel Version

Linux 5.15.131-2-pve #1 SMP PVE 5.15.131-3 (2023-12-01T13:42Z)
PVE Manager Version

pve-manager/7.4-17/513c62be

Thank you so very, very much!!!
 
  • Like
Reactions: UdoB

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!