ubuntu中删除显示为deinstall的linux内核

之前使用ubuntu-tweak清除了多余的linux内核,但是清除完之后输入uname -a命令查看一下当前内核版本:

$ uname -a
Linux ubuntu 3.5.0-52-generic #79~precise1-Ubuntu SMP Fri Jul 4 21:03:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

然后输入以下命令查看目前系统中存在的内核版本:

$ dpkg --get-selections|grep linux
libselinux1					install
libselinux1:i386				install
linux-firmware					install
linux-generic-lts-quantal			install
linux-headers-3.5.0-52				install
linux-headers-3.5.0-52-generic			install
linux-headers-generic-lts-quantal		install
linux-image-3.5.0-42-generic			deinstall
linux-image-3.5.0-43-generic			deinstall
linux-image-3.5.0-44-generic			deinstall
linux-image-3.5.0-45-generic			deinstall
linux-image-3.5.0-46-generic			deinstall
linux-image-3.5.0-47-generic			deinstall
linux-image-3.5.0-48-generic			deinstall
linux-image-3.5.0-49-generic			deinstall
linux-image-3.5.0-51-generic			deinstall
linux-image-3.5.0-52-generic			install
linux-image-generic-lts-quantal			install
linux-libc-dev					install
linux-sound-base				install
pptp-linux					install
syslinux					install
syslinux-common					install
syslinux-legacy					install
util-linux					install

发现还有一些处于deinstall状态,对于有强迫症的我来说,既然都deinstall了,那么也就不应该存在了。使用如下命令就可以清除干净那些deinstall的内核:

sudo dpkg -P linux-image-3.5.0-4[2-9]-generic
sudo dpkg -P linux-image-3.5.0-51-generic

执行完之后,再看看结果:

$ dpkg --get-selections|grep linux
libselinux1					install
libselinux1:i386				install
linux-firmware					install
linux-generic-lts-quantal			install
linux-headers-3.5.0-52				install
linux-headers-3.5.0-52-generic			install
linux-headers-generic-lts-quantal		install
linux-image-3.5.0-52-generic			install
linux-image-generic-lts-quantal			install
linux-libc-dev					install
linux-sound-base				install
pptp-linux					install
syslinux					install
syslinux-common					install
syslinux-legacy					install
util-linux					install

整个世界都清爽了~~


你可能感兴趣的:(ubuntu中删除显示为deinstall的linux内核)