Today, I suddenly had the urge to upgrade the idle server's PVE7.4-17 to the latest PVE8.1, mainly to test the waters for my inter cpu mini host. After all, production equipment cannot be upgraded casually, and failure would be a disaster.
I will skip the previous steps, after all, it is not the point, and there are many tutorials on the Internet. You can refer to this blogger's article:Proxmox VE (PVE) 7.X to 8.0 Upgrade Tutorial.
The key problem is when running to the critical step, running the following command to upgrade pve8.0:
apt dist-upgrade -y
As a result, the following error appears and the upgrade to 8.0 fails:
This may be because I moved some dependencies of ceph when I was preparing to study ceph. No matter what, the problem must be solved. I searched on the Internet for a long time and finally solved it. Here are the steps to solve it.
1. Edit the pveapthook configuration file
vim /etc/apt/apt.conf.d/10pveapthook
As shown below, save and exit:
2. Run the following commands in sequence
dpkg --configure -a apt-get --fix-broken install apt full-upgrade
3. Check the dependencies of librbd1
apt-get install librbd1=16.2.11+ds-2
You can see the dependencies of librbd1 as shown in the red box:
First install the required dependency librados2:
apt-get install librados2=16.2.11+ds-2
4. Then install the following dependencies in sequence:
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
If an error occurs during the installation of a certain step, install the missing dependencies first as in the previous section. For example, an error occurred during the installation of step 4:
I will first run the following command to install the missing dependencies:
apt-get install libcephfs2=16.2.11+ds-2 apt-get install python3-rados=16.2.11+ds-2
Then re-run the command that reported the error and it will succeed.
5. Reinstall proxmox-ve
apt-get install --reinstall proxmox-ve
6. Re-edit the pveapthook configuration file, remove all the "#" comments in it, save and exit, you can reboot here.
7. Re-runapt dist-upgrade -y
, it can be upgraded normally:
Press Enter directly:
Press Enter directly:
success:
Note 1: Before upgrading, you must back up the virtual machines on the old version of PVE. I had a problem before, which resulted in the loss of all the virtual machines. Fortunately, there were not many virtual machines at that time. If it were now, I would probably want to jump off the building. If it is a PVE in a production environment, upgrade with caution. Upgrading across major versions does have risks. Unless you are sure that the new version has new features that are important to you, don't upgrade easily, because for most people, you can hardly feel the difference.
Note 2: If there is a problem during the upgrade process, there is no need to despair. You can directly install the new version using the method of installing PVE on Linux. If all the files are there, the virtual machine will not be lost.