Upgrade failed: pve-apt-hook: not found

IncenTrI

Member
Jan 28, 2021
5
6
8
53
In February 2022, a buggy kernel update messed up my Win10 guest. I took the following steps and removed the problematic kernel.

apt remove pve-kernel-5.13.19-4-pve
pve-efiboot-tool refresh
pve-efiboot-tool kernel list

Ever since then whenever I tried to upgrade, I face errors like:

-----
...
79 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/138 MB of archives.
After this operation, 22.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]
/bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found
E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (127)
E: Failure running script /usr/share/proxmox-ve/pve-apt-hook

System not fully up to date (found 82 new packages)
-----

Any ideas please?
 
Hey,

try apt install proxmox-ve, if this does not work, try adding -f. When you want to remove/not use a specific kernel in the future use pve-efiboot-tool kernel since it can remove kernels or set the default one.
 
Hey,

try apt install proxmox-ve, if this does not work, try adding -f. When you want to remove/not use a specific kernel in the future use pve-efiboot-tool kernel since it can remove kernels or set the default one.
Hi, both failed with errors like

root@host1:~# apt install proxmox-ve -f
...
The following additional packages will be installed:
pve-kernel-5.13 pve-kernel-5.13.19-6-pve
The following NEW packages will be installed:
proxmox-ve pve-kernel-5.13 pve-kernel-5.13.19-6-pve
0 upgraded, 3 newly installed, 0 to remove and 79 not upgraded.
Need to get 0 B/66.9 MB of archives.
After this operation, 328 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
/bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found
E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (127)
E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
 
I did the following and that seems to have solved the problem.

mkdir -p /usr/share/proxmox-ve
touch /usr/share/proxmox-ve/pve-apt-hook
chmod +x /usr/share/proxmox-ve/pve-apt-hook

Thank you.
This solved my problem thank you

Tried to update from 7.1 to 7.4 (success) then 7.4 to 8
In the process, it asked me to remove proxmox-ve and to verify and all that. Bad call. Had to run "apt remove linux-image-amd64 'linux-image-6.1*' "
Had to update the /etc/apt/sources to the updates version repositories for pve and ceph to latest version and kernel
Lost proxmox, luckily I still have my cluster. Now it allows me to update, and download proxmox-ve again.

Sharing to hopefully save someone else
 
Last edited:
  • Like
Reactions: Mukiwa
I did the following and that seems to have solved the problem.

mkdir -p /usr/share/proxmox-ve
touch /usr/share/proxmox-ve/pve-apt-hook
chmod +x /usr/share/proxmox-ve/pve-apt-hook

Thank you.
Thank you!! Worked like a charm!
 

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!