Proxmox PVE安装之后,因为默认的镜像源更新太慢了,需要切换成国内的软件源,具体更换如下:
替换前更新下证书,否则可能由于证书不可用导致 https 无法使用
apt install apt-transport-https ca-certificates
Proxmox PVE使用Vi编辑文本方向键变字母 退格键不能用的解决办法 http://www.kaixinit.com/linux/pve/8899.html
一、Proxmox VE 企业版订阅服务,没有订阅服务,pve-enterprise.list可以注释或删除掉,文件路径/etc/apt/sources.list.d/pve-enterprise.list,vi编辑文件:
vi /etc/apt/sources.list.d/pve-enterprise.list
在文件内容deb前面加个 # 将内容注释掉,内容更改为:
#deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise 以下备选: rm /etc/apt/sources.list.d/pve-enterprise.list #删除该文件
处理好更新源,执行命令:
apt-get update #更新软件库 apt-get list #查看清单
二、Debian 12系统源更换,sources.list 文件更换软件源,文件路径/etc/apt/sources.list,vi编辑文件:
vi /etc/apt/sources.list
清空文件内容:esc键,输入冒号 : 再输入%d 粘贴如下内容后:wq保存退出,可以在软件源地址前增加注释:
CERNET镜像,推荐使用,如下:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.cernet.edu.cn/debian/ bookworm main contrib non-free non-free-firmware # deb-src https://mirrors.cernet.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.cernet.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware # deb-src https://mirrors.cernet.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.cernet.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware # deb-src https://mirrors.cernet.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换 # deb https://mirrors.cernet.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware # # deb-src https://mirrors.cernet.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware # deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
#中科大镜像源,可以备用,如下:
#中科大镜像源 deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.ustc.edu.cn/debian-backports/ bookworm-backports main contrib non-free non-free-firmware deb-src https://mirrors.ustc.edu.cn/debian-backports/ bookworm-backports main contrib non-free non-free-firmware deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
更新一下软件库:
apt-get update #更新软件库 apt-get upgrade #升级软件库
三、CEPH源更换,ceph.list文件更改软件源,文件路径/etc/apt/sources.list.d/ceph.list,vi编辑文件:
vi /etc/apt/sources.list.d/ceph.list
清空文件内容:esc键,输入冒号 : 再输入%d 粘贴如下内容后:wq保存退出。内容更改为:
deb https://mirror.iscas.ac.cn/proxmox/debian/pve bookworm pve-no-subscription 以下备选: deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription
这里用了 no-subscription,但中科大文档里用的是 pve-no-subscription,原因是 中科院源里 里只有叫个 no-subscription 子目录,并没有 pve-no-subscription,因此得根据情况改一下
建议用一键设置,PVE 8 之后默认安装 Ceph 仓库源文件
if [ -f /etc/apt/sources.list.d/ceph.list ]; then CEPH_CODENAME=`ceph -v | grep ceph | awk '{print $(NF-1)}'` source /etc/os-release echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME $VERSION_CODENAME no-subscription" > /etc/apt/sources.list.d/ceph.list fi
更新一下软件库:看下是否正常。
apt-get update #更新软件库
四、Proxmox软件源更换,新建pve-no-subscription.list 文件,文件路径/etc/apt/sources.list.d/pve-no-subscription.list,vi编辑文件:
vi /etc/apt/sources.list.d/pve-no-subscription.list
清空文件内容:esc键,输入冒号 : 再输入%d 粘贴如下内容后:wq保存退出。内容更改为:
deb https://mirror.iscas.ac.cn/proxmox/debian/pve bookworm pve-no-subscription 以下备选: deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bookworm pve-no-subscription deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription
建议用一键设置,使用Proxmox非企业版中科大源
wget https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg echo "deb https://mirrors.ustc.edu.cn/proxmox/debian bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
五、CT Templates源更换,将 /usr/share/perl5/PVE/APLInfo.pm 文件中默认的源地址 http://download.proxmox.com 替换为 https://mirrors.ustc.edu.cn/proxmox 即可,一键更换:
sed -i.bak 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
针对 /usr/share/perl5/PVE/APLInfo.pm 文件的修改,执行如下命令后生效:
systemctl restart pvedaemon
六、LXC仓库源更换,CT模版,APLInfo.pm文件更改,文件路径为/usr/share/perl5/PVE/APLInfo.pm,把 APLInfo.pm 里面的源地址 http://download.proxmox.com替换为https://mirror.ustc.edu.cn/proxmox 中科大的镜像,命令如下:
sed -i 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
更新一下软件库:
apt-get update #更新源列表 apt-get upgrade #升级软件库 apt dist-upgrade #升级系统
七、每次打开都会弹出无效订阅,执行如下命令,reboot等待重启即可。
sed -i.backup -z "s/res === null || res === undefined || \!res || res\n\t\t\t.data.status.toLowerCase() \!== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
apt-get clean - 删除所有已下载的包文件 apt-get update - 取回更新的软件包列表信息 apt-get upgrade - 进行一次升级 systemctl restart pvedaemon.service 重启web刷新页面
参考文献:
阿里云Debian 镜像:https://developer.aliyun.com/mirror/debian?spm=a2c6h.13651102.0.0.65a51b11xvAKLV
Proxmox 软件仓库镜像使用帮助:https://mirror.nju.edu.cn/mirrorz-help/proxmox/?mirror=NJU
在https://mirror.nju.edu.cn/help搜索Proxmox
Proxmox 软件仓库https://mirrors.tuna.tsinghua.edu.cn/help/proxmox/?ref=blog.fillpit.cn
Debian 软件源https://mirror.tuna.tsinghua.edu.cn/help/debian/
Proxmox 软件仓库https://help.mirrors.cernet.edu.cn/proxmox/?mirror=ISRC-ISCAS
原创文章,作者:开心电脑网,如若转载,请注明出处。
评论列表(1条)