Solution to the problem of "pve-apt-hook" error causing upgrade failure when upgrading from PVE 7.4 to 8.1.
This article was last updated 196 days ago. The information in it may have developed or changed. If it is invalid, please leave a message in the comment section.
Article Summary
在升级闲置服务器上的Proxmox VE 7.4至8.1过程中,因pve-apt-hook脚本报错导致升级失败,问题溯源至此前安装Ceph相关依赖的残留影响。通过编辑pve-apt-hook配置文件注释、逐级安装librados2等缺失依赖并修复依赖链后,最终完成升级。实践验证了跨版本升级需谨慎处理依赖关系,建议生产环境升级前做好虚拟机备份,且非必要场景不推荐直接跨大版本更新,可优先通过全新安装方式规避风险。
Qwen3-14B · 2026-06-18

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.

📌 Content Structure Hints:
This content belongs to "Blog Knowledge MapThis is part of the document; you can view the full content path here: Blog Knowledge Map .
View related categories · 3 matches
📎 Related Articles
Share this article
All blog content is original; please indicate the source when reprinting! The blog's RSS address 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
       

👋 Welcome to "Invincible Personal Blog"“

This section will focus on long-term exploration in the following areas:

🧱 Building Personal Digital Infrastructure and Blog Systems
☁️ Cloudflare and Network Architecture Practices
🧠 Exploring AI and Knowledge Systems
🛡️ Network security and access optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspective and Worldview