Ubuntu 删除多余内核

标签: ,

正在查看 0 条回复
  • 作者
    帖子
    • okass - WirelessLink Forumokass
      参与者
      #1377
      Up
      4
      ::

      1. 查看当前内核

      rew $ uname -a
      Linux rew 4.15.0-42-generic #45~16.04.1-Ubuntu SMP Mon Nov 19 13:02:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

       

      2.查看所有内核

      rew $ dpkg –get-selections | grep linux
      console-setup-linux install
      libselinux1:amd64 install
      libselinux1:i386 install
      linux-base install
      linux-firmware install
      linux-generic-hwe-16.04 install
      linux-headers-4.15.0-42 install
      linux-headers-4.15.0-39 install
      linux-headers-4.15.0-39-generic install
      linux-headers-4.15.0-42-generic install
      linux-headers-generic-hwe-16.04 install
      linux-image-4.15.0-39-generic install
      linux-image-4.15.0-42-generic install
      linux-image-generic-hwe-16.04 install
      linux-libc-dev:amd64 install
      linux-libc-dev:i386 install
      linux-modules-4.15.0-39-generic install
      linux-modules-4.15.0-42-generic install
      linux-modules-extra-4.15.0-39-generic install
      linux-modules-extra-4.15.0-42-generic install
      linux-sound-base install
      pptp-linux install
      syslinux install
      syslinux-common install
      syslinux-legacy install
      util-linux install

       

      3.移除多余内核

      rew $ sudo apt-get remove \
      linux-headers-4.15.0-39 \
      linux-headers-4.15.0-39-generic \
      linux-image-4.15.0-39-generic \
      linux-modules-4.15.0-39-generic \
      linux-modules-extra-4.15.0-39-generic

       

      卸载后重新检查:

      rew $ dpkg –get-selections | grep linux

      状态为deinstall即已经卸载,如果觉得看着不舒服的话可以使用purge连配置文件里一起彻底删除,清理内核列表

      rew $ sudo apt-get purge \
      linux-headers-4.15.0-39 \
      linux-headers-4.15.0-39-generic \
      linux-image-4.15.0-39-generic \
      linux-modules-4.15.0-39-generic \
      linux-modules-extra-4.15.0-39-generic

       

      4.更新系统引导

      删除内核后需要更新grub移除失效的启动项

      rew $ sudo update-grub #根据情况选择grub/grub2

      访问ChatGPT的可用VPS机房IP推荐 Lisahost美国原生IP搬瓦工美西DMITTripodcloudFrantech
正在查看 0 条回复
  • 哎呀,回复话题必需登录。
WirelessLink Forum
Logo