因PVE8.0更換了Debian12作為內(nèi)核,軟件源管理方式也發(fā)生了變更,故原軟件源配置方法已失效。
默認是企業(yè)訂閱版,如果不做修改,在使用 pveceph init 進行 ceph 初始化安裝的時候會將整個環(huán)境破壞,切記!
登陸各節(jié)點Shell控制臺
【重要】將/etc/apt/sources.list.d/pve-enterprise.list 文件刪除:
rm -rf /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/ceph.list
Proxmox軟件源更換
南大NJU源(選一個):
echo "deb https://mirrors.nju.edu.cn/proxmox/debian bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
apt update && apt dist-upgrade #更新軟件,可不執(zhí)行
中科大源(選一個):
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
apt update && apt dist-upgrade #更新軟件,可不執(zhí)行
其他可選源:
# 清華Tuna源
echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
Debian系統(tǒng)源更換
阿里Debian源(選一個):
sed -i.bak "s#ftp.debian.org/debian#mirrors.aliyun.com/debian#g" /etc/apt/sources.list #阿里Debian源
sed -i "s#security.debian.org#mirrors.aliyun.com/debian-security#g" /etc/apt/sources.list #阿里Debian源
apt update && apt-get install -y apt-transport-https ca-certificates --fix-missing
華為Debian源(選一個):
sed -i.bak "s#http://ftp.debian.org#https://repo.huaweicloud.com#g" /etc/apt/sources.list #華為Debian源
sed -i "s#http://security.debian.org#https://repo.huaweicloud.com/debian-security#g" /etc/apt/sources.list #華為Debian源
apt update && apt-get install -y apt-transport-https ca-certificates --fix-missing
163-Debian源(選一個):
sed -i.bak "s#ftp.debian.org/debian#mirrors.163.com/debian#g" /etc/apt/sources.list #163Debian源
sed -i "s#security.debian.org#mirrors.163.com/debian-security#g" /etc/apt/sources.list #163Debian源
apt update && apt-get install -y apt-transport-https ca-certificates --fix-missing
LXC倉庫源更換
南大NJU源(選一個):
sed -i.bak "s#http://download.proxmox.com/images#https://mirrors.nju.edu.cn/proxmox/images#g" /usr/share/perl5/PVE/APLInfo.pm
wget -O /var/lib/pve-manager/apl-info/mirrors.nju.edu.cn https://mirrors.nju.edu.cn/proxmox/images/aplinfo-pve-7.dat
systemctl restart pvedaemon
中科大源(選一個):
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-pve-7.dat
systemctl restart pvedaemon
CEPH源更換
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription" > /etc/apt/sources.list.d/ceph.list #中科大源
sed -i.bak "s#http://download.proxmox.com#https://mirrors.ustc.edu.cn/proxmox#g" /usr/share/perl5/PVE/CLI/pveceph.pm #中科大源
設(shè)置Web控制臺默認語言為中文
echo 'language: zh_CN' >> /etc/pve/datacenter.cfg
刪除訂閱彈窗
echo "0 1 * * * sed -Ezi \"s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g\" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js" | crontab -
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
# 執(zhí)行完成后,瀏覽器Ctrl+F5強制刷新緩存
一鍵配置腳本
vim PVE8_Setting.sh
#/bin/bash
#更換軟件源
rm -rf /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/ceph.list
echo "deb https://mirrors.nju.edu.cn/proxmox/debian bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
sed -i.bak "s#http://ftp.debian.org#https://repo.huaweicloud.com#g" /etc/apt/sources.list #華為Debian源
sed -i "s#http://security.debian.org#https://repo.huaweicloud.com/debian-security#g" /etc/apt/sources.list #華為Debian源
apt update && apt-get install -y apt-transport-https ca-certificates --fix-missing
#更換LXC源
sed -i.bak "s#http://download.proxmox.com/images#https://mirrors.nju.edu.cn/proxmox/images#g" /usr/share/perl5/PVE/APLInfo.pm
wget -O /var/lib/pve-manager/apl-info/mirrors.nju.edu.cn https://mirrors.nju.edu.cn/proxmox/images/aplinfo-pve-7.dat
#刪除訂閱彈窗
sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
echo "0 1 * * * sed -Ezi \"s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g\" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js" | crontab -
#設(shè)置Web控制臺默認語言為中文
echo 'language: zh_CN' >>/etc/pve/datacenter.cfg
#下載并導入虛擬機模板
#wget -P /var/lib/vz/dump/ http://192.168.169.2/vzdump-qemu/vzdump-qemu-openEuler2403-x86_64.vma.zst
#qmrestore /var/lib/vz/dump/vzdump-qemu-openEuler2403-x86_64.vma.zst 100
# 重啟相關(guān)服務(wù)
systemctl restart pvedaemon & systemctl restart pveproxy.service