Proxmox VE 中出现 TASK ERROR: command 'apt-get update' failed: exit code 100 的解决方法

一般PVE更新服务器出现问题会输出以下错误日志:

starting apt-get update
Ign:1 http://ftp.debian.org/debian stretch InRelease
Get:2 http://ftp.debian.org/debian stretch Release [118 kB]
Get:3 http://ftp.debian.org/debian stretch Release.gpg [2434 B]
Get:4 http://ftp.debian.org/debian stretch/main amd64 Packages [7123 kB]
Get:5 http://security.debian.org stretch/updates InRelease [63.0 kB]
Get:6 http://security.debian.org stretch/updates/main amd64 Packages [264 kB]
Get:7 http://security.debian.org stretch/updates/main Translation-en [116 kB]
Get:8 http://security.debian.org stretch/updates/contrib amd64 Packages [1352 B]
Get:9 http://security.debian.org stretch/updates/contrib Translation-en [1023 B]
Ign:10 https://enterprise.proxmox.com/debian/pve stretch InRelease
Ign:11 https://enterprise.proxmox.com/debian/pve stretch Release
Ign:12 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise amd64 Packages
Ign:13 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise all Packages
Ign:14 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise Translation-en
Ign:12 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise amd64 Packages
Ign:13 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise all Packages
Ign:14 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise Translation-en
Ign:12 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise amd64 Packages
Ign:13 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise all Packages
Ign:14 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise Translation-en
Ign:12 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise amd64 Packages
Ign:13 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise all Packages
Ign:14 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise Translation-en
Ign:12 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise amd64 Packages
Ign:13 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise all Packages
Ign:14 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise Translation-en
Get:15 http://ftp.debian.org/debian stretch/main Translation-en [5393 kB]
Err:12 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise amd64 Packages
  401  Unauthorized
Ign:13 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise all Packages
Ign:14 https://enterprise.proxmox.com/debian/pve stretch/pve-enterprise Translation-en
Get:16 http://ftp.debian.org/debian stretch/contrib amd64 Packages [50.9 kB]
Get:17 http://ftp.debian.org/debian stretch/contrib Translation-en [45.9 kB]
Fetched 13.2 MB in 30s (425 kB/s)
Reading package lists...
W: The repository 'https://enterprise.proxmox.com/debian/pve stretch Release' does not have a Release file.
E: Failed to fetch https://enterprise.proxmox.com/debian/pve/dists/stretch/pve-enterprise/binary-amd64/Packages  401  Unauthorized
E: Some index files failed to download. They have been ignored, or old ones used instead.
TASK ERROR: command 'apt-get update' failed: exit code 100

在PVE中出现 TASK ERROR: command 'apt-get update' failed: exit code 100 这个错误提示是由于企业版软件源需要付费 (dìng yuè) 才可以访问,免费版实际上应该是使用最多的版本。
未订阅用户如果需要更新Proxmox可以使用Proxmox VE无订阅存储库

Proxmox VE无订阅存储库,pve-no-subscription回购可用于测试和非生产使用。 它不推荐在生产服务器上运行,因为这些软件包并不总是经过严格测试和验证。 顾名思义,没有Proxmox VE订阅密钥需要访问此存储库。
2018.2.6更新:根据研究群里大佬的提醒,Proxmox VE从5.x之后的版本已经是 stretch 了,源还用jessie肯定会失败的,所以本文根据官方wiki文档做了修改,请仔细阅读。

修改 /etc/apt/sources.list

deb http://ftp.debian.org/debian stretch main contrib

# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve stretch pve-no-subscription

# security updates
deb http://security.debian.org stretch/updates main contrib

然后禁用官方的收费服务器:

修改 /etc/apt/sources.list.d/pve-enterprise.list

deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise

在这一句代码前加个#号注释掉即可。改为以下内容

# deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise

附:Proxmox ve关闭登录时的未订阅弹窗

在5.1版本验证通过提醒:升级到5.1-46版本后,官方已经更改了弹窗JS路径。
根据博友uouuou的摸索后发现,Proxmox ve官方在5.1-46版本之后已经更改了弹窗JS路径。
区别在第一步备份及所编辑的JS路径不同
下面提供两种不同版本的解决方案,请根据自己的版本选择对应的操作。
1、备份原始文件
5.1-46版本之前操作如下

root@pve:~# cd /usr/share/pve-manager/js
root@pve:/usr/share/pve-manager/js# cp pvemanagerlib.js pvemanagerlib.jsbak
root@pve:/usr/share/pve-manager/js# vi pvemanagerlib.js

5.1-46版本之后操作如下

root@pve:~# cd /usr/share/javascript/proxmox-widget-toolkit
root@pve:/usr/share/javascript/proxmox-widget-toolkit# cp proxmoxlib.js proxmoxlib.jsbak
root@pve:/usr/share/javascript/proxmox-widget-toolkit# vi proxmoxlib.js

2、找到这一行(5.1 3rd release在第850行,5.1-49在第352行。版本不一样可能对应的位置不一样,建议自己搜索):

if (data.status !== 'Active') {

3、修改为

if (false) {

或者在终端执行下面这行命令

root@pve:~# sed -i "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

现在登录就再也没有烦人的弹窗了!

Last modification:July 18th, 2019 at 01:10 am
如果觉得我的文章对你有用,请随意赞赏

2 comments

  1. 居若

    有用,1024

    1. 拾玖
      @居若

      能用就好

Leave a Comment