【安装记录】Proxmox VE 7.X换源&更换内核

本文详细描述了如何在ProxmoxVE7.x环境中替换企业源为中科大镜像,优化软件包下载,更换内核版本,包括官方内核的安装和管理,以及如何添加云smith.io的测试版内核源。
摘要由CSDN通过智能技术生成

文章转载:https://blog.suysker.xyz/archives/40

以下适用于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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值