Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize Kernel degradation in ubuntu16

Shulou Source: shulou.com Published: 2022-06-02 06:58:34 10月04日 Update

This article shows you how to achieve kernel degradation in ubuntu16, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

1. First download and install the amd64 kernel that installs linux.

two。 View boot sequence

Grep menuentry / boot/grub/grub.cfg

3. A failed attempt

Modify the file / etc/default/grub

Change GRUB_DEFAULT=0 to GRUB_DEFAULT=6

Or change it to

GRUB_DEFAULT= "Ubuntu,Linux 4.15.0-041500-generic"

After saving

Then use the command sudo update-grub

Type uname-r after reboot, and the kernel is still 5.4.0.

4. Manually modify / boot/grub/grub.cfg

Find the following code block:

Linux / vmlinuz-5.4.0-rc5 root=UUID=5bce3795-da96-4c6f-bed2-67d37185a77d ro quiet splash $vt_handoff initrd / initrd.img-5.4.0-rc5

Change it to the kernel you want to use, mine is as follows:

Linux / vmlinuz-4.15.0-45-generic root=UUID=5bce3795-da96-4c6f-bed2-67d37185a77d ro quiet splash $vt_handoff initrd / initrd.img-4.15.0-45-generic

Then restart the computer, if not, please find the following code block (mine is 151 lines).

Submenu 'Ubuntu Advanced option' $menuentry_id_option 'gnulinux-advanced-5bce3795-da96-4c6f-bed2-67d37185a77d'

Delete all the vmlinuz-5.4.0-rc5-related code under this line of code (mine is 152 lines 263) and restart it.

Menuentry 'Ubuntu,Linux vmlinuz-5.4.0-rc5'-- class ubuntu-- class gnu-linux-- class gnu--class os $menuentry_id_option' gnulinux-vmlinuz-5.4.0-rc5-advanced-5bce3795-da96-4c6f-bed2-67d37185a77d' {recordfail load_video gfxmode $linux_gfx_mode insmod gzio if [x$grub_platform = xxen]; then insmod xzio; insmod lzopio Fi insmod part_msdos insmod ext2 set root='hd0,msdos1' if [x$feature_platform_search_hint = xy] Then search-no-floppy-fs-uuid-set=root-hint-bios=hd0,msdos1-hint-efi=hd0,msdos1-hint-baremetal=ahci0,msdos1 88421677-a988-4ff9-bf29-6c56aa4a9027 else search-no-floppy-fs-uuid-set=root 88421677-a988-4ff9-bf29-6c56aa4a9027 fi echo 'load Linux vmlinuz-5.4.0-rc5..' Linux / vmlinuz-5.4.0-rc5 root=UUID=5bce3795-da96-4c6f-bed2-67d37185a77d ro quiet splash $vt_handoff echo 'load initialization memory disk.' Initrd / initrd.img-5.4.0-rc5} menuentry 'Ubuntu, with Linux vmlinuz-5.4.0-rc5 (upstart)'-- class ubuntu-- class gnu-linux-- class gnu--class os $menuentry_id_option 'gnulinux-vmlinuz-5.4.0-rc5-init-upstart-5bce3795-da96-4c6f-bed2-67d37185a77d' {recordfail load_video gfxmode $linux_gfx_mode insmod gzio if [x$grub_platform = xxen] Then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 set root='hd0,msdos1' if [x$feature_platform_search_hint = xy] Then search-no-floppy-fs-uuid-set=root-hint-bios=hd0,msdos1-hint-efi=hd0,msdos1-hint-baremetal=ahci0,msdos1 88421677-a988-4ff9-bf29-6c56aa4a9027 else search-no-floppy-fs-uuid-set=root 88421677-a988-4ff9-bf29-6c56aa4a9027 fi echo 'load Linux vmlinuz-5.4.0-rc5..' Linux / vmlinuz-5.4.0-rc5 root=UUID=5bce3795-da96-4c6f-bed2-67d37185a77d ro quiet splash $vt_handoff init=/sbin/upstart echo 'load initialization memory disk.' Initrd / initrd.img-5.4.0-rc5} menuentry 'Ubuntu, with Linux vmlinuz-5.4.0-rc5 (recovery mode)'-- class ubuntu-- class gnu-linux-- class gnu--class os $menuentry_id_option 'vmlinuz-5.4.0-rc5-recovery-5bce3795-da96-4c6f-bed2-67d37185a77d' {recordfail load_video insmod gzio if [x$grub_platform = xxen]; then insmod xzio; insmod lzopio Fi insmod part_msdos insmod ext2 set root='hd0,msdos1' if [x$feature_platform_search_hint = xy] Then search-no-floppy-fs-uuid-set=root-hint-bios=hd0,msdos1-hint-efi=hd0,msdos1-hint-baremetal=ahci0,msdos1 88421677-a988-4ff9-bf29-6c56aa4a9027 else search-no-floppy-fs-uuid-set=root 88421677-a988-4ff9-bf29-6c56aa4a9027 fi echo 'load Linux vmlinuz-5.4.0-rc5..' Linux / vmlinuz-5.4.0-rc5 root=UUID=5bce3795-da96-4c6f-bed2-67d37185a77d ro recovery nomodeset echo 'load initialization memory disk.' Initrd / initrd.img-5.4.0-rc5}

5. However, after executing sudo update-grub, you still put version 5.4.0 at the forefront of startup.

But dpkg-- get-selections | grep linux did not find a kernel of 5.4.0.

Enter / boot, delete the files and folders related to 5.4.0, and then execute sudo update-grub.

When deleting the 5.4.0 kernel and related packages, you must operate when you are currently using kernel 4.15. Otherwise, the system crashes.

The system is clean, leaving only a 4.15 kernel.

The above is how to achieve kernel degradation in ubuntu16. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Kernel code memory files content skills knowledge systems no clean concise advanced concise commands that is manual folders articles more computer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology macOS MariaDB Linux Xiaomi