本文介绍Debian系统更新Linux内核。
一、通过更新源自动升级kernel
更新package
sudo apt update sudo apt upgrade sudo apt dist-upgrade
安装新版内核镜像
sudo apt-cache search linux-image
linux-image-amd64-dbg - Debugging symbols for Linux amd64 configuration (meta-package) linux-image-amd64-signed-template - Template for signed linux-image packages for amd64 linux-image-cloud-amd64-dbg - Debugging symbols for Linux cloud-amd64 configuration (meta-package) linux-image-rt-amd64-dbg - Debugging symbols for Linux rt-amd64 configuration (meta-package) linux-image-amd64 - Linux for 64-bit PCs (meta-package) linux-image-cloud-amd64 - Linux for x86-64 cloud (meta-package) linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package) u-boot-efi-dtb - copy DTBs to the EFI System Partition from the linux-image-* packages linux-headers-6.12.69+deb13-amd64 - Header files for Linux 6.12.69+deb13-amd64 linux-headers-6.12.69+deb13-cloud-amd64 - Header files for Linux 6.12.69+deb13-cloud-amd64 linux-headers-6.12.69+deb13-rt-amd64 - Header files for Linux 6.12.69+deb13-rt-amd64 linux-image-6.12.69+deb13-amd64-dbg - Debug symbols for linux-image-6.12.69+deb13-amd64 linux-image-6.12.69+deb13-amd64-unsigned - Linux 6.12 for 64-bit PCs linux-image-6.12.69+deb13-cloud-amd64-dbg - Debug symbols for linux-image-6.12.69+deb13-cloud-amd64 linux-image-6.12.69+deb13-cloud-amd64-unsigned - Linux 6.12 for x86-64 cloud linux-image-6.12.69+deb13-rt-amd64-dbg - Debug symbols for linux-image-6.12.69+deb13-rt-amd64 linux-image-6.12.69+deb13-rt-amd64-unsigned - Linux 6.12 for 64-bit PCs, PREEMPT_RT linux-image-6.12.69+deb13-amd64 - Linux 6.12 for 64-bit PCs (signed) linux-image-6.12.69+deb13-cloud-amd64 - Linux 6.12 for x86-64 cloud (signed) linux-image-6.12.69+deb13-rt-amd64 - Linux 6.12 for 64-bit PCs (signed), PREEMPT_RTsudo apt install linux-image-amd64安装额外的工具
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev重启系统
sudo update-grub sudo apt-get clean sudo reboot检查下,已经切到了新内核
uname -r 6.12.73+deb13-amd64清理
sudo apt purge linux-image-6.12.69+deb13-amd64二、手动升级kernel
在 mirrors.kernel.org 上直接下载deb包,比如当前最新版本为 6.18.9 :
wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-image-6.18.9%2Bdeb14-amd64-dbg_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-image-6.18.9%2Bdeb14-amd64-unsigned_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-image-6.18.9%2Bdeb14-cloud-amd64-dbg_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-image-6.18.9%2Bdeb14-cloud-arm64-unsigned_6.18.9-1_arm64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-kbuild-6.18.9%2Bdeb14_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-headers-6.18.9%2Bdeb14-amd64_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-headers-6.18.9%2Bdeb14-cloud-amd64_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-headers-6.18.9%2Bdeb14-rt-amd64_6.18.9-1_amd64.deb wget https://mirrors.edge.kernel.org/debian/pool/main/l/linux/linux-headers-6.18.9%2Bdeb14-common_6.18.9-1_all.deb sudo dpkg -i linux-*.deb查看新安装的内核
dpkg -l | grep linux重启系统
sudo update-grub sudo apt-get clean sudo reboot检查下,已经切到了新内核
uname -r 6.19_amd64清理
sudo apt purge linux-image-6.18-amd64
乔大海个人网站 https://qiaodahai.com/