跳转至

1 PVE 更换清华源 关闭订阅弹窗

在 Proxmox VE (PVE) 上更换为清华大学的镜像源并关闭弹窗提示,可以按照以下步骤进行:


步骤 1:备份源文件

在更改之前,建议先备份原始源文件:

cp /etc/apt/sources.list /etc/apt/sources.list.bak
如果使用企业版 PVE,还需要备份企业源:
cp /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak


步骤 2:更换为清华大学镜像源

编辑 /etc/apt/sources.list

nano /etc/apt/sources.list

替换内容为以下清华大学的镜像源(适配 PVE):

deb http://mirrors.tuna.tsinghua.edu.cn/debian bullseye main contrib
deb http://mirrors.tuna.tsinghua.edu.cn/debian bullseye-updates main contrib
deb http://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports main contrib
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib

deb http://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bullseye pve-no-subscription


步骤 3:禁用 PVE 企业订阅源

如果你没有订阅企业支持,建议注释掉企业源,运行以下命令:

sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list


步骤 4:更新系统缓存

运行以下命令以更新系统软件包列表:

apt update


步骤 5:关闭无订阅弹窗

禁用无订阅弹窗提示的方法如下: 1. 编辑文件 /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

nano /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

  1. 找到以下代码片段:

    if (data.status !== 'Active') {
        Ext.Msg.show({
            title: gettext('No valid subscription'),
            // ...
        });
    }
    
    注释掉或删除这段代码即可。

  2. 保存退出后,清理浏览器缓存,并重启 PVE 服务:

    systemctl restart pveproxy
    


完成以上步骤后,PVE 的源已经更换为清华大学镜像,且无订阅弹窗已被禁用。