在使用 Proxmox VE (PVE) 进行 apt update 更新时,如果遇到 401 未授权 或 GPG 签名文件丢失 的错误,请参考以下方案直接修复。
1. 问题现象
报错 A:401 Unauthorized (企业源未订阅)
Err:4 https://enterprise.proxmox.com/debian/pve trixie InRelease
401 Unauthorized [IP: 51.79.228.122 443]
Error: The repository 'https://enterprise.proxmox.com/debian/pve trixie InRelease' is not signed.
报错 B:Keyring GPG Error (签名文件路径错误)
Err:4 http://download.proxmox.com/debian/pve trixie InRelease
Error: Failed to parse keyring "/usr/share/keyrings/proxmox-ve-release-keyring.gpg"
Caused by: No such file or directory (os error 2)
2. 解决方案
适用于使用 .sources 格式的新版 PVE (Debian 12/13+)。
第一步:禁用企业源
编辑以下两个文件,将 Enabled: yes 改为 Enabled: no,或者直接注释掉所有内容。
/etc/apt/sources.list.d/pve-enterprise.sources/etc/apt/sources.list.d/ceph.sources
第二步:配置 No-Subscription 源 (修正 Keyring 路径)
新版 PVE 的 GPG 密钥文件名已变更为 proxmox-archive-keyring.gpg,请直接使用以下正确配置。
1. 新建/编辑 PVE 源文件nano /etc/apt/sources.list.d/pve-no-subscription.sources
写入以下内容:
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
2. (可选) 新建/编辑 Ceph 源文件nano /etc/apt/sources.list.d/ceph-no-subscription.sources
写入以下内容:
Types: deb
URIs: http://download.proxmox.com/debian/ceph-squid
Suites: trixie
Components: no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
第三步:更新系统
配置完成后,执行更新即可:
apt update && apt upgrade -y