想切换不同系统内核怎么办?按下面步骤即可:
第一步:查找内核:grep submenu /boot/grub/grub.cfg
1 |
submenu 'Ubuntu 高级选项' $menuentry_id_option 'gnulinux-advanced-3f5e97d5-cd08-4560-94df-613149aac32e' { |
第二步:查找想要使用的内核 grep gnulinux /boot/grub/grub.cfg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$ grep gnulinux /boot/grub/grub.cfg set default="gnulinux-advanced-3f5e97d5-cd08-4560-94df-613149aac32e>gnulinux-4.4.248-0404248-generic-advanced-3f5e97d5-cd08-4560-94df-613149aac32e" menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3f5e97d5-cd08-4560-94df-613149aac32e' { submenu 'Ubuntu 高级选项' $menuentry_id_option 'gnulinux-advanced-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu,Linux 4.15.1-041501-lowlatency' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.1-041501-lowlatency-advanced-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.15.1-041501-lowlatency (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.1-041501-lowlatency-init-upstart-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.15.1-041501-lowlatency (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.1-041501-lowlatency-recovery-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu,Linux 4.15.1-041501-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.1-041501-generic-advanced-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.15.1-041501-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.1-041501-generic-init-upstart-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.15.1-041501-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.1-041501-generic-recovery-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu,Linux 4.4.248-0404248-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.248-0404248-generic-advanced-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.4.248-0404248-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.248-0404248-generic-init-upstart-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.4.248-0404248-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.248-0404248-generic-recovery-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu,Linux 4.4.0-141-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-141-generic-advanced-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.4.0-141-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-141-generic-init-upstart-3f5e97d5-cd08-4560-94df-613149aac32e' { menuentry 'Ubuntu, with Linux 4.4.0-141-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-141-generic-recovery-3f5e97d5-cd08-4560-94df-613149aac32e' { |
选择我们想要切换的内核,这里我选择的为:gnulinux-4.4.248-0404248-generic-advanced-3f5e97d5-cd08-4560-94df-613149aac32e
第三步:修改grub文件,切换内核:vim /etc/default/grub
,根据第一步和第二步得到的内核,修改为下面高亮行:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' #GRUB_DEFAULT="gnulinux-advanced-3f5e97d5-cd08-4560-94df-613149aac32e>gnulinux-4.4.0-141-generic-recovery-3f5e97d5-cd08-4560-94df-613149aac32e" #GRUB_DEFAULT="gnulinux-4.4.0-141-generic-recovery-3f5e97d5-cd08-4560-94df-613149aac32e>gnulinux-advanced-3f5e97d5-cd08-4560-94df-613149aac32e" GRUB_DEFAULT="gnulinux-advanced-3f5e97d5-cd08-4560-94df-613149aac32e>gnulinux-4.4.248-0404248-generic-advanced-3f5e97d5-cd08-4560-94df-613149aac32e" GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" |
第四步:更新grub:sudo update-grub
更新完之后,重启即可。
重启之后检查一下内核:uname -r
,可以发现,内核已改。
升级内核:
Ubuntu升级系统内核
由于很多原因,比如兼容更新的驱动程序,需要升级系统内核,下面是步骤,整个步骤还是非常简单的: 转到此处: http://kernel.ubuntu.com/~kernel-ppa/mainline/ ...
时间:2020/12/19 分类:Linux 人气:661 评论:0
本文最后更新于2020年12月19日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!