expired@expired:~$ sudo apt-get remove Linux-image-2.6.35-25-generic The following packages will be REMOVED: Linux-image-2.6.35-25-generic 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 139MB disk space will be freed. Do you want to continue [Y/n]? y
出现以上提示问是否继续,按y或者直接回车继续。完成后会有如下提示:
1 2 3 4 5 6 7 8 9 10 11 12 13
DKMS: uninstall Completed. Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-25-generic /boot/vmlinuz-2.6.35-25-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.35-25-generic /boot/vmlinuz-2.6.35-25-generic Generating grub.cfg ... Found Linux image: /boot/vmlinuz-2.6.35-28-generic Found initrd image: /boot/initrd.img-2.6.35-28-generic Found Linux image: /boot/vmlinuz-2.6.35-27-generic Found initrd image: /boot/initrd.img-2.6.35-27-generic Found memtest86+ image: /memtest86+.bin Found Windows 7 (loader) on /dev/sda1 Found Windows Vista (loader) on /dev/sda4 done
expired@expired:~$sudo apt-get purge Linux-image-3.2.0-26-generic Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: Linux-image-3.2.0-26-generic* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 286964 files and directories currently installed.) Removing Linux-image-3.2.0-26-generic ... Purging configuration files for Linux-image-3.2.0-26-generic ... Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic
因为之前已经remove过了,所以只留下个配置在数据库记录中,再purge时无空间释放。 0 B of additional disk space will be used 再次看下运行后的结果
1 2 3 4 5 6
expired@expired:~$ dpkg --get-selections | grep Linux-image Linux-image-3.2.0-32-generic install Linux-image-generic install expired@expired:~$ dpkg -l | grep Linux-image ii Linux-image-3.2.0-32-generic 3.2.0-32.51 Linux kernel image for version 3.2.0on64 bit x86 SMP ii Linux-image-generic 3.2.0.32.35 Generic Linux kernel image