ubuntu换内核
查看当前安装的内核
| Bash |
|---|
| sudo dpkg -l | grep linux-image
或
sudo dpkg --get-selections|grep linux
或
ll /boot
|
查看当前使用的内核
cat /proc/version
uname -a
查看可以更新的内核版本
| Bash |
|---|
| sudo apt-cache search linux-image
|
| Bash |
|---|
| #内核相关的几个包
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
|
安装新内核
| Bash |
|---|
| 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
重启
| Bash |
|---|
| sudo reboot
#或
sudo init 6
|
卸载旧内核
| Bash |
|---|
| sudo apt-get purge linux-image-xx-generic linux-image-extra-xx-generic
|