TL;DR
| |
Once proxmox-ve is reinstalled, the real hook replaces the empty one and apt is back to normal.
The error
| |
It shows up on any apt install, apt upgrade, or apt full-upgrade, and blocks everything, including whatever you try in order to fix it.
Why it happens
The proxmox-ve package installs two things that belong together:
| File | What it is |
|---|---|
/etc/apt/apt.conf.d/10pveapthook | Tells apt to run the hook before every dpkg operation |
/usr/share/proxmox-ve/pve-apt-hook | The hook: protects proxmox-ve and the Proxmox kernel from being removed by mistake |
If proxmox-ve went away (a miscalculated apt remove or autoremove, an interrupted dist-upgrade, a half-installed package), the script disappears but the file under /etc/apt/apt.conf.d/ is a conffile and stays. apt keeps trying to run a script that no longer exists and fails before touching anything.
Fix if you want to keep Proxmox
The empty hook only gets apt running; the point is to reinstall proxmox-ve:
| |
Check that the hook is now the real one and not your empty file:
| |
After that, apt full-upgrade and a reboot to confirm the Proxmox kernel comes up.
Fix if you removed Proxmox on purpose
If the box is going back to plain Debian, the snippet is leftover:
| |
apt remove leaves conffiles behind; purge takes them with it.
Traps
- Do not leave the empty hook in place. It exists so apt cannot remove
proxmox-veor theproxmox-kernel-*package by accident. With the empty file that protection is gone. - Check what left together with
proxmox-ve. If apt removed it, it probably took dependencies along;apt install proxmox-vebrings them back, but read the list before accepting. - If
apt install proxmox-vecannot find the package, the problem is in the repos: no-subscription repositories. - Reference: Proxmox forum thread.