【温馨提醒】
❉大版本的系统更新会有更新失败的风险,更新前你要考虑清楚:能否承受更新失败带来的后果?以及更新系统后虚拟机能否顺利启动?
❉生产环境用机不建议升级更新!生产环境用机不建议升级更新!生产环境用机不建议升级更新!
❉根据PVE官网的【升级说明】,在升级到PVE8.0之前,需要先更新到PVE7.4-15。
❉在正式操作之前,必须把虚拟机全部关机,并取消所有虚拟机的“自动启动”设置。有重要数据的话强烈建议先备份!
【升级步骤】
-
修改
/etc/vim/vimrc.tiny
set nocompatible set backspace=2
-
依次输入以下命令(每次复制一行,到PVE的Shell里面粘贴,按回车执行),目的是替换源以及把PVE版本更新到7.4-15版本;
rm -rf /etc/apt/sources.list.d/pve-install-repo.list 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 sed -i.bak "s#ftp.debian.org/debian#mirrors.aliyun.com/debian#g" /etc/apt/sources.list sed -i "s#security.debian.org#mirrors.aliyun.com/debian-security#g" /etc/apt/sources.list echo "deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription" >> /etc/apt/sources.list
-
修改
/etc/apt/sources.list
deb https://mirrors.aliyun.com/debian bullseye main co://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 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 http://mirrors.aliyun.com/debian bullseye-updates main contrib # security updates deb http://mirrors.aliyun.com/debian-security bullseye-security main contrib deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription # 添加清华源 deb 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 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
-
编辑pve企业源:
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak # 在末尾添加免费的存储库 echo "deb http://security.debian.org/debian-security bullseye-security main contrib" >> /etc/apt/sources.list echo "deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription" >> /etc/apt/sources.list.d/pve-enterprise.list
-
执行更新
apt update && apt dist-upgrade -y
-
更新中,耐心等待;
-
当命令全部运行结束后,会回到“root@pve:~#”这样的命令行状态,点PVE菜单上的重启键,重启一次;
-
重启完成再进入到Shell状态下,此时可以看到系统版本已经变成7.4-15了;
-
输入命令
pve7to8
回车,检查一下是否符合升级要求; -
还好只有一个警告项,然后FAILUSER这一项的数字为0,证明可以升级;
= SUMMARY =
TOTAL: 29
PASSED: 23
SKIPPED: 5
WARNINGS: 1
FAILUSER: 0
ATTENTION: Please check the output for detailed information!
- 复制下面三行命令到PVE的Shell里面粘贴,按回车执行;
sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
echo "deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise" > /etc/apt/sources.list.d/pve-enterprise.list
echo "deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription" > /etc/apt/sources.list.d/ceph.list
-
输入
apt update
回车; -
如果出现“Failed to fetch ******** 401 Unauthorized”这个错误;
-
复制下面命令到PVE的Shell里面粘贴,按回车执行;
echo "#deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise" > /etc/apt/sources.list.d/pve-enterprise.list
-
再次输入命令
apt update
回车,这次就不会报错了; -
输入命令
apt dist-upgrade -y
回车,开始升级PVE8.0; -
升级过程中会弹出这些界面,需要我们手动确认,无需选择,全部直接按回车就行了;
-
当命令全部运行结束后,会回到
root@pve:~#
这样的命令行状态,这样就更新成功了; -
不需要重启,直接把电脑浏览器关掉,重新登录进入PVE,会看到版本已经变成8.0.3了;
-
在Shell状态下输入
apt autoremove -y
回车,并输入y
回车,自动清理本次升级更新产生的临时文件; -
至此,升级工作全部完成!
参考文档
- Proxmox VE(PVE) 7.X 升级到 8.0 教程 - GXNAS博客
- Upgrade from 7 to 8 - Proxmox VE
- 升级PVE7到最新版本并设置国内源 - 伟成 - 博客园
- 解决 ProXmoX VE升级 apt-get update 报错的问题 - 幻月无名 - 博客园
- pve在执行apt-get update更新软件包时报错_pve更新软件包数据库错误-CSDN博客
- PVE使用apt-get update更新出现401的解决办法-CSDN博客
- PVE8.0正式版来啦!7.x升级到8方法:1命令行升级 2备份重装还原|爱折腾的老高博客
- proxmox7.4升级到8_pve7.4升级8.0-CSDN博客
- proxmox集群从7.4升级到最新的8.1_proxmox 升级-CSDN博客
- proxmox+ceph集群完整方案/完整方案 - 知乎
- PVE8.0正式版来啦!7.x升级到8方法:1命令行升级 2备份重装还原