Skip to content

pve修改国内源

以7的为例

参考:https://blog.csdn.net/qq_34499205/article/details/119966796

1.1 执行命令

以此执行一下命令

echo "#deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise" > /etc/apt/sources.list.d/pve-enterprise.list
wget https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-pacific bullseye main" > /etc/apt/sources.list.d/ceph.list
sed -i.bak "s#http://download.proxmox.com/debian#https://mirrors.ustc.edu.cn/proxmox/debian#g" /usr/share/perl5/PVE/CLI/pveceph.pm

清华源

tee /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
EOF

阿里源(推荐使用)

tee /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free-firmware non-free
deb-src http://mirrors.aliyun.com/debian/ bookworm main contrib non-free-firmware non-free

deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free-firmware non-free
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free-firmware non-free

deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free-firmware non-free
deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free-firmware non-free

deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free-firmware non-free
deb-src http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free-firmware non-free
EOF

更新源

apt-get update && apt-get upgrade && apt-get dist-upgrade -y

替换源以后安装vim

apt-get install -y vim

6.1 Proxmox VE 内核

安装 pvekclean,可以不安装

apt update && apt -y install git && rm -rf ./pvekclean/ && git clone https://hub.fastgit.org/jordanhillis/pvekclean.git && cd pvekclean && chmod +x pvekclean.sh && ./pvekclean.sh

apt update && apt -y install git && rm -rf ./pvekclean/ && git clone https://github.com/jordanhillis/pvekclean.git && cd pvekclean && chmod +x pvekclean.sh && ./pvekclean.sh

运行 pvekclean执行删除

pvekclean -f

调整服务器时间,如果有ntp服务可以指向内网的

tee /etc/systemd/timesyncd.conf << EOF
[Time]
NTP=192.168.1.2 ntp.aliyun.com cn.pool.ntp.org
EOF