Ubuntu刪除多余內核的方法
第一步:查看當前內核
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
當前使用版本為: 4.15.0-42-generic
第二步:查看所有內核
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
第三步:移除冗余內核
所有 39 版本的對我來說都是多余的,進行刪除:
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 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-42-generic install linux-headers-generic-hwe-16.04 install linux-image-4.15.0-39-generic deinstall 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 deinstall linux-modules-4.15.0-42-generic install linux-modules-extra-4.15.0-39-generic deinstall 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
狀態(tài)為 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
第四步:更新系統(tǒng)引導
刪除內核后需要更新 grub 移除失效的啟動項
rew $ sudo update-grub #根據(jù)情況選擇grub/grub2
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
詳解apache編譯安裝httpd-2.4.54及三種風格的init程序特點和區(qū)別
這篇文章主要介紹了apache編譯安裝httpd-2.4.54以及三種風格的init程序特點和區(qū)別?,通過編譯安裝httpd來深入理解源碼包安裝(httpd-2.4.54),本文給大家介紹的非常詳細,需要的朋友可以參考下2022-07-07error while loading shared libraries xx.so處理方法
一般我們在Linux下執(zhí)行某些外部程序的時候可能會提示找不到共享庫(error while loading shared libraries xx.so)的錯誤2013-04-04Canonical通過Flutter啟用Linux桌面應用程序(推薦)
這篇文章主要介紹了Canonical通過Flutter啟用Linux桌面應用程序,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-07-07Linux 下安裝 memcached 及 memcacheq的方法
這篇文章主要介紹了Linux 下安裝 memcached 及 memcacheq的方法,需要的朋友可以參考下2017-03-03