Debian10升级系统内核,其他版本没试过

查看内核:uname -r

更新系统

执行系统更新操作:

apt update && apt full-upgrade -y
apt install lsb-release

更新系统的 apt 源

debian 10

cat > /etc/apt/sources.list << EOF
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc) main contrib non-free
deb http://cdn-aws.deb.debian.org/debian-security $(lsb_release -sc)/updates main contrib non-free
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-updates main contrib non-free
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-backports main contrib non-free
deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-proposed-updates main contrib non-free
# deb http://cdn-aws.deb.debian.org/debian $(lsb_release -sc)-backports-sloppy main contrib non-free
EOF

debian 11

cat > /etc/apt/sources.list << EOF
deb http://cdn-aws.deb.debian.org/debian bullseye main
deb-src http://cdn-aws.deb.debian.org/debian bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main
deb http://cdn-aws.deb.debian.org/debian bullseye-updates main
deb-src http://cdn-aws.deb.debian.org/debian bullseye-updates main
deb http://cdn-aws.deb.debian.org/debian bullseye-backports main
deb-src http://cdn-aws.deb.debian.org/debian bullseye-backports main
EOF

更新 apt 的本地包信息:

apt update

安装新版内核

apt search linux-image
apt install -t $(lsb_release -sc)-backports linux-image-$(dpkg --print-architecture) linux-headers-$(dpkg --print-architecture) --install-recommends -y
update-grub
reboot

如果提示E: Unable to correct problems, you have held broken packages.
执行:

apt install linux-image-5.10.0-0.bpo.12-amd64
update-grub
reboot

清理工作

获取已经不需要的旧版内核

dpkg -l | grep linux

linux-image-4.19.0-17-amd64 为例,删除:

apt purge linux-image-4.19.0-17-amd64

文章来源

最后修改:2023 年 05 月 17 日 01 : 59 PM