Solution to the problem of "pve-apt-hook" reporting an error when upgrading PVE 7.4 to 8.1, which leads to upgrade failure
本文最后更新于 284 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。

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:

image.png

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

image.png

As shown below, save and exit:
image.png

2. Run the following commands in sequence

dpkg --configure -a apt-get --fix-broken install apt full-upgrade

image.png

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:

image.png

First install the required dependency librados2:

apt-get install librados2=16.2.11+ds-2

image.png

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:

image.png

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:

image.png

Press Enter directly:
image.png

Press Enter directly:
image.png

success:
image.png

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.

The content of the blog is original. Please indicate the source when reprinting! For more blog articles, you can go toSitemapUnderstand. The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if necessary, you can joinTelegram GroupDiscuss the problem together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠(ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ°Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Emoticons
Emoji
Little Dinosaur
flower!
Previous
Next
       
error:
en_US
Spring Festival
hapiness