[SOLVED] Cannot use apt after proxmox-ve removal

esi_y

Renowned Member
Nov 29, 2023
2,221
366
63
github.com
EDIT: Original title was "permanently remove 'proxmox-ve' ... touch '/please-remove-proxmox-ve'"

Why is it all packaged like this?

There's a script at /usr/share/proxmox-ve/pve-apt-hook that looks for /please-remove-proxmox-ve otherwise apt remove shows:

Code:
W: (pve-apt-hook) !! WARNING !!
W: (pve-apt-hook) You are attempting to remove the meta-package 'proxmox-ve'!
W: (pve-apt-hook)
W: (pve-apt-hook) If you really want to permanently remove 'proxmox-ve' from your system, run the following command
W: (pve-apt-hook)     touch '/please-remove-proxmox-ve'
W: (pve-apt-hook) run apt purge proxmox-ve to remove the meta-package
W: (pve-apt-hook) and repeat your apt invocation.
W: (pve-apt-hook)
W: (pve-apt-hook) If you are unsure why 'proxmox-ve' would be removed, please verify
W: (pve-apt-hook)     - your APT repository settings
W: (pve-apt-hook)     - that you are using 'apt full-upgrade' to upgrade your system

First of all, APT had already asked me if sure.

Second, when the file is there anything goes, so e.g.:

Code:
# apt remove proxmox-ve

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  proxmox-ve
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 27.6 kB disk space will be freed.
Do you want to continue? [Y/n] y
W: (pve-apt-hook) '/please-remove-proxmox-ve' exists, proceeding with removal of package 'proxmox-ve'
(Reading database ... 45484 files and directories currently installed.)
Removing proxmox-ve (8.1.0) ...



# apt install proxmox-ve

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  proxmox-ve
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5,032 B of archives.
After this operation, 27.6 kB of additional disk space will be used.
/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/ave-apt-hook

.. so it's worse than doing nothing.

Why can't one keep the configs and why doesn't it all just work...

Code:
# apt download proxmox-ve
# dpkg -i proxmox-ve_8.1.0_all.deb

Selecting previously unselected package proxmox-ve.
(Reading database ... 45481 files and directories currently installed.)
Preparing to unpack proxmox-ve_8.1.0_all.deb ...
Unpacking proxmox-ve (8.1.0) ...
Setting up proxmox-ve (8.1.0) ...



# apt install proxmox-ve

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
proxmox-ve is already the newest version (8.1.0).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.



# ls /usr/share/proxmox-ve/

pve-apt-hook

So, why all the hocus pocus with if ($pkg eq 'proxmox-ve') { if ($action eq '**REMOVE**') { if (-e $check_file) {?
 
Last edited:
Hi,
well, some users run apt with the -y switch, so this is an additional safeguard. Just don't remove Proxmox VE from your system if you want to use Proxmox VE.

I just shamelessly bump this up as there's lots of staff now. I think it's a bug. And no I do not mind the odd file requirement as much as the rest.
You're doing a disservice to the hundreds of other users, many with more important issues.
 

Hi!

well, some users run apt with the -y switch, so this is an additional safeguard. Just don't remove Proxmox VE from your system if you want to use Proxmox VE.

Not but realistically I want to remove a component to add it back, I do not want to purge config files. I cannot do it (see the sequence above) without manual dpkg later to fix it. Something's off there. Any component will trigger the meta removal and then the hook is gone for the next invocation, or so I think.

(On the touch /please - I would have thought this could have been some non-standard prompt rather than file which then stays behind.)

You're doing a disservice to the hundreds of other users, many with more important issues.

I knew the touch /filename was your authoring!

But today, I am ready to accept decisions of others. I still can't get over bugs though.
(Does a stalled discussion in pve-devel that ended with rescinding a reversion mean it's a silent go?)
 
Not but realistically I want to remove a component to add it back, I do not want to purge config files. I cannot do it (see the sequence above) without manual dpkg later to fix it. Something's off there. Any component will trigger the meta removal and then the hook is gone for the next invocation, or so I think.
Yes, this could be considered a bug. But the warning even says If you really want to permanently remove 'proxmox-ve' from your system. I'm not sure there are guarantees that everything works as expected after doing removal + install. We do not test this. Best to just re-install the system if you want to go back to using Proxmox VE later.
I knew the touch /filename was your authoring!
No it's not. Why do you think so?
 
Yes, this could be considered a bug. But the warning even says If you really want to permanently remove 'proxmox-ve' from your system. I'm not sure there are guarantees that everything works as expected after doing removal + install.

But that's the issue, I do not want to, but it's a meta and wants to go, but those dependencies are not auto-installed, so they will not go:

Code:
# apt purge --dry-run  proxmox-ve

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

The following packages will be REMOVED:
  proxmox-ve*
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
Purg proxmox-ve [8.1.0]

# apt show pve-manager | grep Manual

APT-Manual-Installed: yes

So next if I even want to e.g. remove the rest, it will keep looking for the sad (and since gone) /usr/share/proxmox-ve/pve-apt-hook and not even work, neither way. Installing back same problem. It's in a limbo.

We do not test this. Best to just re-install the system if you want to go back to using Proxmox VE later.

See above. Idk if it would work with dpkg -r --force-depends, but even if I followed the "supported" path I am stuck.





(Does a stalled discussion in pve-devel that ended with rescinding a reversion mean it's a silent go?)

I take it as a yes then.
 
With the meta gone ...

Code:
# apt remove pve-manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  pve-manager
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 2,642 kB disk space will be freed.
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
 
Oh, I see. Yes, it should be possible to remove the other packages without running into errors. Please file a bug report for this.

(Does a stalled discussion in pve-devel that ended with rescinding a reversion mean it's a silent go?)
I'm not sure what you mean here. If it's about the syslog-patch, it's still open. The decision to apply or reject it lies with other maintainers. And there are a lot of open patches that also deserve to be looked at.
 
Oh, I see. Yes, it should be possible to remove the other packages without running into errors. Please file a bug report for this.

Filed regarding both bugs:

Bug 5257 - apt commands fail after removal proxmox-ve
Bug 5258 - apt remove proxmox-ve (or any package) is quirky

Put it under "Installer" as there's no better component option.

You're doing a disservice to the hundreds of other users, many with more important issues.

So I guess it wasn't so bad after all.

No it's not. Why do you think so?

Just the feel of consideration/kindness for everyone in the filename.

I'm not sure what you mean here. If it's about the syslog-patch, it's still open. The decision to apply or reject it lies with other maintainers. And there are a lot of open patches that also deserve to be looked at.

Thanks, I think I do not understand how the workflow is there, but good to know, so I can contribute without spamming, the jury is still out.

BTW When something is "applied", where do I find it? In the test repo?
 
So the culprit was:

Code:
# cat /etc/apt/apt.conf.d/10pveapthook
DPkg::Pre-Install-Pkgs { "/usr/share/proxmox-ve/pve-apt-hook"; };
DPkg::Tools::Options::/usr/share/proxmox-ve/pve-apt-hook "";
DPkg::Tools::Options::/usr/share/proxmox-ve/pve-apt-hook::Version "2";
DPkg::Tools::Options::/usr/share/proxmox-ve/pve-apt-hook::InfoFD "20";

Setting this one as solved here, but of course the bugreport remains valid. It blocks every APT call. Pretty mind-boggling that removing proxmox-ve is never tested?
 

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!