Skip to content

Latest commit

 

History

History
60 lines (57 loc) · 2.25 KB

23-10-01PVE8初始化.md

File metadata and controls

60 lines (57 loc) · 2.25 KB

Proxmox VE 8.0 日常维护

01.修改源等

设置更新源为国内华为源(目前debian国内最全的),删除付费企业源,添加清华开源订阅

设置 debian 华为源 - For PVE 8.x

cat > /etc/apt/sources.list <<EOF
deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free contrib
deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free contrib
deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free contrib
EOF

删除企业源 - For PVE 8.x

rm -rf /etc/apt/sources.list.d/pve-enterprise.list

添加下载秘钥 - For PVE 8.x下载密钥

wget http://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg

添加国内开源订阅 - For PVE 8.x

echo "deb http://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" >/etc/apt/sources.list.d/pve-install-repo.list
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription" > /etc/apt/sources.list.d/ceph.list

删除订阅提示

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

02.系统更新

日常软件更新命令:

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

更新PVE,并安装常用软件

apt-get update && apt-get install vim lrzsz unzip net-tools curl screen uuid-runtime git -y && apt dist-upgrade -y

确认无误后,重新启动服务器

reboot

移除未使用的Linux内核

若不存在pvekclean,请先安装

git clone https://github.com/jordanhillis/pvekclean.git
cd pvekclean
chmod +x pvekclean.sh

安装完成后执行pvekclean即可

./pvekclean.sh