UBUNTU switch core

Inquiries can be made to replace the kernel number

    gedit /boot/grub/grub.cfg

query the installed kernel and kernel number. Locate the file in menuentry (the figure in a lot of fi-else underneath)

menuentry which also includes submenu, under submenu contains the menuentry with an indent. The following are counting rules:

    first menuentry the numbers 0, the second submenu is the number 1, and so on
    in the submenu, the first menuentry the numbers 0, 1 second, so

I excerpt FIG the first submenu menuentry follows:

menuentry 'the Ubuntu, the Linux-4.15.0-34 Generic' --class Ubuntu --class gnulinux --class GNU --class OS $ menuentry_id_option 'gnulinux-4.15.0 Generic-advanced---34 261d46dc-b223-49ee-a561-439009b15519 '{
        recordfail
        load_video
        gfxmode $ linux_gfx_mode
        the insmod gzio
        IF [X = $ grub_platform xxen]; the then the insmod xzio; lzopio the insmod; Fi
        the insmod part_gpt
        the insmod the performance of ext2
        = the root SET 'hd0, GPT2'
        IF [X = $ feature_platform_search_hint XY]; the then
          Search --no-CFTD --fs the --set = the root-UUID = hd0 --hint-BIOS, EFI-GPT2 --hint = hd0 , GPT2 --hint-baremetal = ahci0, GPT2 261d46dc-b223-49ee-a561-439009b15519
        the else
          Search --no-CFTD --fs the --set-UUID = the root-a561-439009b15519 b223-49ee 261d46dc-
        Fi
        echo 'carrier 4.15.0-34-Generic ... into the Linux '
            Linux /boot/vmlinuz-4.15.0-34-generic the UUID = 261d46dc = the root-b223-49ee RO-a561-439009b15519 Splash $ vt_handoff quiet
        echo' Loading initialize the memory disk ... '
        the initrd /boot/initrd.img-4.15.0-34-generic


mean, this is menuentry kernel Linux 4.15.0-34-generic serial number of the menu. Here it is assumed that I need to replace the kernel for it. It's the first menuentry in the submenu. Remember it the next use.

(3) modified to replace the kernel grub

    sudo gedit / etc / default / grub

open the grub editing window, as shown:


If no kernel grub modified, in addition to the first line of the comment is to be displayed

    GRUB_DEFAULT 0 =

0 is the default the kernel. We have to do is to GRUB_DEFAULT = 0 into

    GRUB_DEFAULT = "1> 0"

can be. Note that the need to replace the kernel Linux 4.15.0-34-generic mentioned in (2) in the first menuentry submenu, and therefore "1> 0." If it is in the first five submenu, then is "1> 4", the only need is a few good this!

Also, please note that one pair semicolon "" 1 and the space after is a must, absolutely must, but also not much!

(4) update the kernel and reboot

    sudo Update-GRUB
    sudo reboot

to restart the complete query can use uname -a kernel has been replaced.

Guess you like

Origin www.cnblogs.com/penuel/p/11323004.html