Linux Deepin删除旧内核文件的方法

本文发布时间: 2019-Mar-22
Linux Deepin 在升级新的内核后,如何删除旧的内核文件?举例来说,假设我们刚刚运行了 apt-get dist-upgrade 升级到了仓库中最新的内核版本(如从 3.2.0-30 升级到了 3.2.0-34)#crayon-50bc585fd319a .crayon-plain { font-size: 12px !important; line-height: 16px !important;}$ sudo apt-get dist-upgrade Reading package lists... DoneBuilding dependency tree Reading state information... DoneCalculating upgrade... DoneThe following NEW packages will be installed: libframe6 libgeis1 libgrail5 linux-headers-3.2.0-34 linux-headers-3.2.0-34-generic linux-image-3.2.0-34-genericThe following packages will be upgraded: libgrip0 linux-headers-generic linux-image-generic3 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.Need to get 50.9 MB of archives.After this operation, 181 MB of additional disk space will be used.Do you want to continue [Y/n]? y...首先我们需要知道已经安装了哪些内核版本,可以使用下面的命令:$ dpkg --get-selections | grep linuxfonts-linuxlibertine installlibselinux1 installlinux-firmware installlinux-headers-3.2.0-30 installlinux-headers-3.2.0-30-generic installlinux-headers-3.2.0-34 installlinux-headers-3.2.0-34-generic installlinux-headers-generic installlinux-image-3.2.0-30-generic installlinux-image-3.2.0-34-generic installlinux-image-generic installlinux-libc-dev installlinux-sound-base installpptp-linux installsyslinux installsyslinux-common installutil-linux install这样,我们就可以从中找到旧的内核文件(linux-headers-3.2.0-30 linux-headers-3.2.0-30-generic linux-image-3.2.0-30-generic),相应地将他们删除:#crayon-50bc585fd323c .crayon-plain { font-size: 12px !important; line-height: 16px !important;}$ sudo apt-get purge linux-headers-3.2.0-30 linux-headers-3.2.0-30-generic linux-image-3.2.0-30-generic Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages will be REMOVED: linux-headers-3.2.0-30* linux-headers-3.2.0-30-generic* linux-image-3.2.0-30-generic*0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.After this operation, 180 MB disk space will be freed.Do you want to continue [Y/n]? y...Linux Deepin 在使用 apt-get 更新与删除旧内核后会自动调用 update-grub 更新 grub.cfg 文件,这样,我们就不用担心删除旧内核后因为 grub 的配置原因而无法从新的内核启动的问题。重启后,我们即可在新的 grub 菜单中从新内核启动。


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2019-May-25 12:58pm
栏目列表