如何删除新内核并使旧内核成为默认内核(16.04)


19

我将内核升级到版本4.4.8,以尝试启用挂起/休眠状态,但是依次降低了电池寿命。所以我想

一个。在我的Ubuntu 16.04 LTS中删除je 4.4.8并还原到4.4.0内核

b。保留新的内核,但使用旧的(4.4.0)默认引导内核。

我对此没有一点经验,所以我想一步步和单挑:)

另外,我应该坚持使用出厂的内核并等待系统的修复和更新,还是应该升级我认为合适的内核。有什么建议?

dpkg -l的输出| grep Linux

ii  console-setup-linux                           1.108ubuntu15                                       all          Linux specific part of console-setup
ii  ladspa-sdk                                    1.13-2                                              amd64        sample tools for linux-audio-dev plugin architecture
ii  libselinux1:amd64                             2.4-3build2                                         amd64        SELinux runtime shared libraries
ii  libselinux1:i386                              2.4-3build2                                         i386         SELinux runtime shared libraries
ii  libv4l-0:amd64                                1.10.0-1                                            amd64        Collection of video4linux support libraries
ii  libv4lconvert0:amd64                          1.10.0-1                                            amd64        Video4linux frame format conversion library
ii  linux-base                                    4.0ubuntu1                                          all          Linux image base package
ii  linux-firmware                                1.157                                               all          Firmware for Linux kernel drivers
ii  linux-generic                                 4.4.0.21.22                                         **amd64        Complete Generic Linux kernel and headers
ii  linux-headers-4.4.0-21                        4.4.0-21.37                                         all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-21-generic                4.4.0-21.37                                         amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP**
ii  linux-headers-4.4.8-040408                    4.4.8-040408.201604200335                           all          Header files related to Linux kernel version 4.4.8
ii  linux-headers-4.4.8-040408-generic            4.4.8-040408.201604200335                           amd64        Linux kernel headers for version 4.4.8 on 64 bit x86 SMP
ii  linux-headers-generic                         4.4.0.21.22                                         amd64        Generic Linux kernel headers
ii  linux-image-4.4.0-21-generic                  4.4.0-21.37                                         amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.8-040408-generic              4.4.8-040408.201604200335                           amd64        Linux kernel image for version 4.4.8 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-21-generic            4.4.0-21.37                                         amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-generic                           4.4.0.21.22                                         amd64        Generic Linux kernel image
ii  linux-libc-dev:amd64                          4.4.0-21.37                                         amd64        Linux Kernel Headers for development
ii  linux-sound-base                              1.0.25+dfsg-0ubuntu5                                all          base package for ALSA and OSS sound systems
ii  linux-tools-4.4.0-21                          4.4.0-21.37                                         amd64        Linux kernel version specific tools for version 4.4.0-21
ii  linux-tools-4.4.0-21-generic                  4.4.0-21.37                                         amd64        Linux kernel version specific tools for version 4.4.0-21
ii  linux-tools-common                            4.4.0-21.37                                         all          Linux kernel version specific tools for version 4.4.0
ii  linux-tools-virtual                           4.4.0.21.22                                         amd64        This package will always depend on the latest minimal generic kernel tools.
ii  pptp-linux                                    1.8.0-1                                             amd64        Point-to-Point Tunneling Protocol (PPTP) Client
ii  syslinux                                      3:6.03+dfsg-11ubuntu1                               amd64        collection of bootloaders (DOS FAT and NTFS bootloader)
ii  syslinux-common                               3:6.03+dfsg-11ubuntu1                               all          collection of bootloaders (common)
ii  syslinux-legacy                               2:3.63+dfsg-2ubuntu8                                amd64        Bootloader for Linux/i386 using MS-DOS floppies
ii  util-linux                                    2.27.1-6ubuntu3                                     amd64        miscellaneous system utilities

Answers:


20

重新启动计算机,当通过快速按下BIOS shift来打开GRUB菜单时,您可能需要几次尝试才能确定正确的时间。

在此处选择“高级”选项,然后选择使用旧内核启动。然后,您可以安全地卸载属于较新内核的所有内容并使用它来完成:

sudo apt-get remove "linux-headers-4.4.8*"
sudo apt-get remove "linux-image-4.4.8*"

尝试这样做时,它尝试删除所有以前的内核,包括我想要的内核。但是它没有试图删除最后一个。computer.login:〜$ sudo apt-get删除“ linux-headers-4.15.0-45 *” [...] sapant suivants serontENLEVÉS:linux-generic linux-headers-4.15.0-43 linux-headers- 4.15.0-43-generic linux-headers-4.15.0-44 linux-headers-4.15.0-44-generic linux-headers-generic 0错误,0 novellementinstallés,6错误和17 no错误。Apréscetteopération,180年代现代空间的解放。Souhaitez-vous继任者?[O / n] n纪念日。
Autiwa

1
使用UEFI时,请按退出键。
holmberd

从18.04版开始,您将不再能使用用户removepurge仅删除单个内核更新,它也会删除通用映像。
本杰明·R

@BenjaminR:能否请您链接该信息的资源,因为在我的18.04上,该方法很棒。
Videonauth

@Videonauth做removepurgelinux-image-5.0.0-31-generic说,linux-image-generic-hwe-18.04将被删除,以及我指定的任何内核版本。我自己再次检查了一下。
本杰明·R
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.