PVE上使用Linux PVE使用LXC容器安装Linux 更换国内CT模板下载镜像源

时间:2023-5-6    作者:DOG    分类: 知识


PVE可能存在无法联通网络问题,如ping www.baidu.com 提示无法联通,则可以按照如下步骤解决,如果不解决PVE网络问题,则以下更换镜像源则无法继续。

在PVE shell中输入以下命令
nano /etc/resolv.conf
在弹出的窗口中最下面增加如下内容
nameserver 114.114.114.114
crtl+x,输入Y,按回车保存即可
在创建LXC容器之前,首先我们要修改 CT Templates (LXC 容器) 源。我们从PVE后台打开Shell命令行,复制以下命令并运行.

cp /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm_back
sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
重启PVE或者运行systemctl restart pvedaemon.service
第二种方法:直接复制如下全部命令,并粘贴到PVE shell命令号运行

grep -rn "download.proxmox.com" /usr/share/perl5/PVE/*
sed -i.bak "s#http://download.proxmox.com/images#https://mirrors.ustc.edu.cn/proxmox/images#g" /usr/share/perl5/PVE/APLInfo.pm
wget -O /var/lib/pve-manager/apl-info/mirrors.ustc.edu.cn https://mirrors.ustc.edu.cn/proxmox/images/aplinfo.dat
重启PVE或者运行systemctl restart pvedaemon.service