Error with update: /bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found

Andy_Wismer

Active Member
Jul 16, 2018
11
0
41
60
Hello

During an update of one of my customers home server running Proxmox 5.x (With Community Subscription) I had an error during a usual "apt-get dist-upgrade". The command at some point asked me to:
touch '/please-remove-proxmox-ve'
which I did. Still problems...
A reboot just made things worse.
I can now login via SSH, but not with the Web-Interface.

I get the following errors if I try the "apt-get dist-upgrade" command:

------------------
Screenshot Quote :
------------------
apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
proxmox-widget-toolkit pve-i18n pve-xtermjs
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
libpve-apiclient-perl
The following packages will be upgraded:
base-files bsdutils ca-certificates dpkg file gnupg gnupg-agent gpgv isc-dhcp-client
isc-dhcp-common libblkid1 libcurl3-gnutls libfdisk1 libgcrypt20 libicu57 libldap-2.4-2
libldap-common libmagic-mgc libmagic1 libmount1 libpam-systemd libperl5.24 libprocps6
libsmartcols1 libsmbclient libssl1.0.2 libssl1.1 libsystemd0 libudev1 libuuid1 libvorbis0a
libvorbisenc2 libwbclient0 libxapian30 linux-libc-dev mount openssl patch perl perl-base
perl-modules-5.24 procps pve-cluster python3-reportbug reportbug samba-common samba-libs
smbclient systemd systemd-sysv tzdata udev util-linux wget
54 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/42.2 MB of archives.
After this operation, 51.2 kB 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
------------------

Any ideas how I can correct this situation?

Thanks
Andy
 
Hi,

please install proxmox-ve

Code:
apt install proxmox-ve
 
Hi
Thanks for the fast reply. Tried it, but still get the following error:

/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
...

Can I just copy that file from another proxmox server?
 
No, because you are in an undefined state.

Did you tried
Code:
apt install -f
 
Hi
Just did, but I just get:

apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
proxmox-widget-toolkit pve-i18n pve-xtermjs
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.

Thanks!
Andy
 
Since I do have a Proxmox Staff member here, I'd like to say how much I like and appreciate Proxmox!
I have moved / migrated 10+ clients using VMWare ESXi to Proxmox. Mostly on the same Hardware, some on newer Hardware.
All have at least a community subscription!

Just my 2 cents - and appreciation!
Andy
 
FYI: The server is (so far) a stand-alone PVE, a Synology NAS provides DiskStorage, ISOs, and Dump-Space. This whole NAS is again saved daily to an older NAS. Only ProxMox and it's configuration (like SNMP) is on the Box, a HP MicroServer G8.
Reinstalling the server would be not much of a hassle, except it's one of those cases where going there takes twice the time needed for a reinstall... ;-)
 
Since I do have a Proxmox Staff member here, I'd like to say how much I like and appreciate Proxmox!
That's nice to hear.

Normally it is not necessary.
I guess you have a package conflict and we should find this because the likelihood is high that you will have it in future again.

can you send the output of

Code:
pveversion -v
 
AFAIK, My "traditional" additions when installing are:

mc, htop, nano, screen, snmp, snmpd, mostly also the nut (client & server as needed) packages.
 
This package has no dependency conflicts with Proxmox VE.

please try to install this package and if you get an error send the whole output.

Code:
apt install pve-manager
 
Hi

Here's the whole output:
-------------------
root@bhzh-pve-1:~# apt install pve-manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libperl5.24 libpve-apiclient-perl perl perl-base perl-modules-5.24 pve-cluster
Suggested packages:
perl-doc make
Recommended packages:
rename
The following NEW packages will be installed:
libpve-apiclient-perl pve-manager
The following packages will be upgraded:
libperl5.24 perl perl-base perl-modules-5.24 pve-cluster
5 upgraded, 2 newly installed, 0 to remove and 49 not upgraded.
Need to get 0 B/9,869 kB of archives.
After this operation, 9,498 kB 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
root@bhzh-pve-1:~#
-------------------
 
Just for curosity's sake:
If a server needs a reinstall, what about the Subscription (That's based on the Server-ID).
On the same Hardware, the Server-ID should be the same?
Would additional steps be needed?
What if the Hardware was replaced (warrenty or other reason)

Thanks for this info.
 
On the same Hardware, the Server-ID should be the same?
Yes, normally the Id will only change on a new installation.

But you can reset your subscription 3 times per year in the shop.
 
Can you send the output of this command

Code:
sudo dpkg -l | grep pve*
 
I know this is an older post but I figured I would post a temporary, possibly dangerous solution since it might circumvent dependencies. I got this error when I downgraded proxmox-ve then tried to re-upgrade it at a later date. This likely applies to anyone having issues related to:
Code:
/bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found
Which I believe is related to this patch https://pve.proxmox.com/pipermail/pve-devel/2018-April/031338.html regarding the addition of a hook script to prevent users from messing with conflicting dependencies (which I suppose I am doing, so do this at your own risk o_O).
I simply created the file pve-apt-hook by executing the command
Code:
# mkdir /usr/share/proxmox-ve
# nano /usr/share/proxmox-ve/pve-apt-hook
I wrote empty lines to the script, then saved it with ctrl+o ctrl+x. I then made it executable with
Code:
chmod u+x /usr/share/proxmox-ve/pve-apt-hook
Then re-installed proxmox-ve with
Code:
apt install proxmox-ve
and it worked. I then removed the hook file when I was done. Hope this helps somebody.
 
Thank you Elfy,
i had the same problem - with your workarround - it worked

HEY! This is an old post but I just wanted to add that I ran into this same issue when I upgraded to Proxmox v6!
After following your steps for the workaround it for the most part solved my issue. After a successful upgrade I was good, however I now need to follow this procedure to install updates on my server.