参考链接:https://blog.csdn.net/weixin_46123670/article/details/125777787
1、查看linux中安装的内核镜像
dpkg --get-selections | grep linux-image //查看linux中安装的内核镜像
dpkg --get-selections | grep linux //查看linux中内核对应的所有文件

2、查找你要的版本

root@node1:/lib/modules# dpkg --get-selections | grep 5.4.0-125
linux-headers-5.4.0-125 install
linux-headers-5.4.0-125-generic install
linux-image-5.4.0-125-generic install
linux-modules-5.4.0-125-generic install
linux-modules-extra-5.4.0-125-generic install
3、执行安装命令 (→升级内核):
sudo apt-get install linux-image-5.4.0-125-generic
sudo apt-get install linux-headers-5.4.0-125-generic
sudo apt-get install linux-headers-5.4.0-125
sudo apt-get install linux-modules-5.4.0-125-generic
sudo apt-get install linux-modules-extra-5.4.0-125-generic
dpkg -l |grep 5.4.0-125-generic
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu,with Linux 5.4.0-125-generic"
4、如果重启发现,还是没有达到预期 (一般默认加载都是选择最高的版本号)。
那就继续卸载当前的内核版本号,直到降级到你需要的版本【谨慎操作,不能是使用中的内核】
直到系统选择(降级或者升级)到你所需要的内核
→ 降级内核
dpkg -l |grep 5.15.0-32-generic
sudo apt-get remove linux-modules-5.15.0-32-generic
sudo apt-get remove linux-image-unsigned-5.15.0-32-generic
sudo apt-get remove linux-modules-extra-5.15.0-32-generic
不要盲目执行purge操作,执行remove即可
sudo dpkg -P linux-modules-5.15.0-32-generic
出现以下界面的时候☆☆☆☆一定要选择No

网友评论