在通用内核和 xanmod 内核之间切换

在通用内核和 xanmod 内核之间切换

我正在使用 Ubuntu 20.04。我最近安装了 xanmod 内核,但是我想改回通用内核。我该怎么做?

输出dpkg -l | grep linux-image

rc  linux-image-5.0.0-23-generic               5.0.0-23.24~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.0.0-31-generic               5.0.0-31.33~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.0.0-32-generic               5.0.0-32.34~18.04.2                   amd64        Signed kernel image generic
rc  linux-image-5.0.0-36-generic               5.0.0-36.39~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.0.0-37-generic               5.0.0-37.40~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-26-generic               5.3.0-26.28~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-28-generic               5.3.0-28.30~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-40-generic               5.3.0-40.32~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-42-generic               5.3.0-42.34~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-45-generic               5.3.0-45.37~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-46-generic               5.3.0-46.38~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-51-generic               5.3.0-51.44~18.04.2                   amd64        Signed kernel image generic
rc  linux-image-5.3.0-59-generic               5.3.0-59.53~18.04.1                   amd64        Signed kernel image generic
rc  linux-image-5.4.0-42-generic               5.4.0-42.46                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-45-generic               5.4.0-45.49                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-47-generic               5.4.0-47.51                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-48-generic               5.4.0-48.52                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-51-generic               5.4.0-51.56                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-52-generic               5.4.0-52.57                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-53-generic               5.4.0-53.59                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-54-generic               5.4.0-54.60                           amd64        Signed kernel image generic
rc  linux-image-5.4.0-56-generic               5.4.0-56.62                           amd64        Signed kernel image generic
ii  linux-image-5.4.0-58-generic               5.4.0-58.64                           amd64        Signed kernel image generic
ii  linux-image-5.8.16-xanmod1                 5.8.16-xanmod1-0~git20201018.dc69f04  amd64        Linux kernel, version 5.8.16-xanmod1
rc  linux-image-5.8.5-xanmod1                  5.8.5-xanmod1-0~git20200827.65efbed   amd64        Linux kernel, version 5.8.5-xanmod1
rc  linux-image-5.9.11-xanmod1                 5.9.11-xanmod1-0~git20201125.23f9b7a  amd64        Linux kernel, version 5.9.11-xanmod1
ii  linux-image-5.9.13-xanmod2                 5.9.13-xanmod2-0~git20201208.4d5bf39  amd64        Linux kernel, version 5.9.13-xanmod2
ii  linux-image-5.9.14-xanmod1                 5.9.14-xanmod1-0~git20201212.991c8eb  amd64        Linux kernel, version 5.9.14-xanmod1
ii  linux-image-generic                        5.4.0.58.61                           amd64        Generic Linux kernel image

通用内核仍在我的系统中,只是没有“激活”。

我尝试过apt remove linux-image-5.9.14-xanmod1,但结果只是回到原点linux-image-5.9.13-xanmod2

我也编辑了/etc/default/grub此行GRUB_DEFAULT='gnulinux-5.4.0-58-generic-advanced-b813c97f-cc0b-4c15-90de-e2fd416fd68e',但没有任何区别。

我如何卸载 xanmod 并使用通用内核?

答案1

您已安装 Ubuntu 内核。使用 grub 菜单启动 Ubuntu 内核,并使用 synaptic 删除所有 xanmod 内核映像。

您需要将它们全部删除,而不是最后一个。

答案2

我将GRUB_DEFAULT=0其改为GRUB_DEFAULT=saved并添加GRUB_SAVEDEFAULT=true到我的/etc/default/grub,因此它将使用我最后选择的任何内核。

我正在使用 ZFS 根,因此保留一些内核会有所帮助,以防新内核由于某种原因无法启动系统……

以下是head该文件的网址,您可以查看其示例:

# head -n 10 /etc/default/grub

GRUB_DEFAULT=saved
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
# GRUB_HIDDEN_TIMEOUT=10
GRUB_SAVEDEFAULT=true
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on iommu=pt intremap=no_x2apic_optout transparent_hugepage=always vfio-mdev=on"
GRUB_CMDLINE_LINUX=""

GRUB_DISABLE_OS_PROBER=true

5-13.0-2x不过,我不会像你一样保留那么多内核。这太过分了。写完这篇文章后,我打算删除除最新软件包之外的所有软件包。

# apt list --installed | grep linux-image | cut -d '/' -f1

linux-image-5.10.94-xanmod2
linux-image-5.13.0-27-generic
linux-image-5.13.0-28-generic
linux-image-5.13.0-29-generic
linux-image-5.15.0-18-generic
linux-image-5.15.17-xanmod2
linux-image-generic

相关内容