侧边栏壁纸
  • 累计撰写 64 篇文章
  • 累计创建 46 个标签
  • 累计收到 94 条评论

目 录CONTENT

文章目录

Proxmox VE 7.X换源&更换内核

草莓牛奶
2022-07-04 / 0 评论 / 2 点赞 / 3,503 阅读 / 956 字 / 正在检测是否收录...
温馨提示:
「博客文章out of date 会及时更新,无特殊说明仍然有效,欢迎指正内容中的错误」

目前PVE 8.0已经发布,可以参考以下文件进行升级,更新后默认安装linux 6.2内核
从Proxmox VE 7 升级到Proxmox VE 8 一份完整的指南(pve7to8)

以下适用于Proxmox VE 7.x更换源,SSH登录到pve后台,然后执行命令。

一.处理掉企业源:

1.设置 debian 中科大源 - For PVE 7.x

将默认的Debian源更换为中科大的镜像源,以便提高软件包下载速度和可用性。

cat > /etc/apt/sources.list <<EOF
deb http://mirrors.ustc.edu.cn/debian/ bullseye main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ bullseye-updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ bullseye-backports main non-free contrib
deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main non-free contrib
EOF

由于涉及主源和更新、安全、backports等不同源的更换,因此代码块内的每一行都是必要的。

2.删除企业源 - For PVE 7.x

此步骤移除Proxmox的企业源并注释掉,避免后续更新时使用收费的企业源,符合非商业使用或者测试环境的需求。

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

3.下载秘钥 - For PVE 7.x

下载并添加中科大提供的Proxmox签名密钥,确保后续从该源下载的软件包的完整性和安全性。

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

4.添加国内源 - For PVE 7.x

添加中科大的Proxmox源,提供国内快速访问的软件包下载和更新途径。

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

5.修改自带的CEPH源 - For PVE 7.x

如果系统中使用了CEPH,这一步替换CEPH源为中科大源可以提高访问速度。如果没有使用CEPH,可以省略此步骤。

echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-pacific bullseye main" > /etc/apt/sources.list.d/ceph.list

6.更新 - For PVE 7.x

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

二.更换内核版本

2.1安装官方内核

#查看已安装内核
dpkg --get-selections |grep kernel

#查看当前内核
uname -a

#安装官方内核
#apt install pve-kernel-5.19
apt install pve-kernel-6.1

#重启
reboot

#更新官方内核
apt update -y
apt upgrade -y

2.2切换指定版本官方内核

#查看已安装内核
dpkg --get-selections |grep kernel

#查看当前内核
uname -a

#查找内核
apt-cache search linux | grep 'PVE Kernel Image'

#安装制定版本内核
#apt install pve-kernel-5.19
apt install pve-kernel-6.1
#apt install pve-kernel-5.13.19-2-pve

#查看当前系统内核启动顺序
grep menuentry /boot/grub/grub.cfg

#修改内核启动顺序
nano /etc/default/grub

#把默认的GRUB_DEFAULT=“0”改为
GRUB_DEFAULT="Advanced options for Proxmox VE GNU/Linux>Proxmox VE GNU/Linux, with Linux 5.13.19-2-pve"

#更新引导并重启
update-grub
reboot

2.3添加高版本内核源(测试版)

#Add the repository's GPG key:
curl -1sLf 'https://dl.cloudsmith.io/public/pve-edge/kernel/gpg.8EC01CCF309B98E7.key' | gpg --dearmor -o /usr/share/keyrings/pve-edge-kernel.gpg

#Set up the pve-edge-kernel repository:
echo "deb [signed-by=/usr/share/keyrings/pve-edge-kernel.gpg] https://dl.cloudsmith.io/public/pve-edge/kernel/deb/debian bullseye main" > /etc/apt/sources.list.d/pve-edge-kernel.list

三.删除未使用内核

#删除所有不必要的包
apt --purge autoremove
 
#删除指定内核
apt --purge remove pve-kernel-5.13.19-2-pve
2

评论区