Skip to content

ubuntu换内核 ​

查看当前安装的内核 ​

shell
sudo dpkg -l | grep linux-image
或
sudo dpkg --get-selections|grep linux
或
ll /boot

查看当前使用的内核 ​

cat /proc/version uname -a

查看可以更新的内核版本 ​

shell
sudo apt-cache search linux-image
shell
#内核相关的几个包
linux-headers-5.4.0-92
linux-headers-5.4.0-92-generic
linux-image-5.4.0-92-generic
linux-modules-5.4.0-92-generic
linux-modules-extra-5.4.0-92-generic

安装新内核 ​

shell
sudo apt-get install linux-image-xx-generic

18.04修改 ​

修改 /etc/default/grub
将GRUB_DEFAULT=0
修改为
GRUB_DEFAULT=“Advanced options for Ubuntu>Ubuntu, with Linux 4.15.0-45-generic”

更新 grub ​

shell
sudo update-grub

重启 ​

shell
sudo reboot
#或
sudo init 6

卸载旧内核 ​

shell
sudo apt-get purge linux-image-xx-generic linux-image-extra-xx-generic