Today, on a whim, I wanted to upgrade PVE 7.4-17 on my idle server to the latest PVE 8.1, mainly to pave the way for my Intel CPU mini PC first. After all, production equipment cannot be upgraded casually; it would be a disaster if it failed.
I will skip the previous steps, as they are not the main focus, and there are already many tutorials online. You can refer to this blogger's article:Proxmox VE (PVE) 7.X to 8.0 Upgrade Tutorial。
The key issue occurred when running the critical step, executing the following command to upgrade to PVE 8.0:
apt dist-upgrade -y
As a result, the error shown in the figure below occurred, causing the upgrade to 8.0 to fail:

This might be related to some Ceph dependencies I modified when I was planning to study Ceph earlier. Anyway, once a problem arises, it must be solved. After searching the internet for a long time, I finally resolved it. Here, I will record the troubleshooting steps.
Edit the pveapthook configuration file
vim /etc/apt/apt.conf.d/10pveapthook

As shown below, then save and exit:

Run the following commands in sequence
dpkg --configure -a
apt-get --fix-broken install
apt full-upgrade

apt-get --fix-broken install
apt-get install librbd1=16.2.11+ds-2
Check the dependencies of librbd1

apt-get install librbd1=16.2.11+ds-2
apt-get install librados2=16.2.11+ds-2

First install the required dependency librados2:
apt-get install librbd1=16.2.11+ds-2
apt-get install python3-ceph-argparse=16.2.11+ds-2
apt-get install python3-ceph-common=16.2.11+ds-2
apt-get install python3-cephfs=16.2.11+ds-2
apt-get install python3-rbd=16.2.11+ds-2
Then install the following dependencies in sequence:

apt-get install librbd1=16.2.11+ds-2
apt-get install libcephfs2=16.2.11+ds-2
apt-get install python3-rados=16.2.11+ds-2
apt-get install python3-ceph-common=16.2.11+ds-2
apt-get install python3-cephfs=16.2.11+ds-2
apt-get install --reinstall proxmox-ve
If an error occurs during a certain step of the installation, install the missing dependencies first, just like in the previous section. For example, I encountered an error when installing the 4th item:
So I ran the following command first to install the missing dependencies:apt dist-upgrade -yapt-get install libcephfs2=16.2.11+ds-2

apt-get install python3-rados=16.2.11+ds-2

apt-get install python3-rados=16.2.11+ds-2

Success:

Then rerun the command that failed, and it will succeed.
Reinstall proxmox-ve