ubuntu18.04内核降级方法指导

  • 查看可用linux内核版本:grep menuentry /boot/grub/grub.cfg
    • 从结果中发现有5.0.0-13以及4.18.0-18两个版本
    • 如果没有想用的版本可以下载相应的内核
      • 以4.15.0版本为例,下载下面三个deb文件
        • linux-headers-4.15.0-041500rc9_4.15.0-041500rc9.201801212130_all.deb
        • linux-headers-4.15.0-041500rc9-generic_4.15.0-041500rc9.201801212130_amd64.deb
        • linux-image-4.15.0-041500rc9-generic_4.15.0-041500rc9.201801212130_amd64.deb
      • sudo dpkg -i *.deb
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
0 menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5b5cabf4-e78b-457c-b10f-b662ba4c57d9' {
1---submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-5b5cabf4-e78b-457c-b10f-b662ba4c57d9' {
 0---menuentry 'Ubuntu, with Linux 5.0.0-13-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.0.0-13-generic-advanced-5b5cabf4-e78b-457c-b10f-b662ba4c57d9' {
 1---menuentry 'Ubuntu, with Linux 5.0.0-13-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.0.0-13-generic-recovery-5b5cabf4-e78b-457c-b10f-b662ba4c57d9' {
 2---menuentry 'Ubuntu, with Linux 4.18.0-18-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-18-generic-advanced-5b5cabf4-e78b-457c-b10f-b662ba4c57d9' {
 3---menuentry 'Ubuntu, with Linux 4.18.0-18-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-18-generic-recovery-5b5cabf4-e78b-457c-b10f-b662ba4c57d9' {
2---menuentry 'Memory test (memtest86+)' {
3---menuentry 'Memory test (memtest86+, serial console 115200)' {
  • 修改/etc/default/grub文件
    • GRUB_DEFAULT="1 > 3"
    • #"1 >3"这个表示启动序号1中,子序号为3的启动项,即'Ubuntu, with Linux 4.18.0-18-generic (recovery mode)'

    • #若无子序号,则只需填入序号即可

    • # 关于GRUB_DEFAULT的值,有教程是写menuentry后单引号里的内容,但尝试后不成功,故推荐使用数字序号

  • 更新grub
    • sudo update-grub
    • sudo reboot
  • 确认版本
    • uname -r

你可能感兴趣的:(操作系统相关博文,ubuntu内核,内核降级)