怎么删除不了这个内核的东西

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
rodren
帖子: 100
注册时间: 2007-11-23 12:54
联系:

怎么删除不了这个内核的东西

#1

帖子 rodren » 2009-04-10 22:28

rodren@rodren:~$ sudo aptitude purge ~ilinux-image-.*\(\!`uname -r`\)
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
The following packages are BROKEN:
linux-restricted-modules-2.6.27-9-generic
The following packages will be REMOVED:
linux-image-2.6.27-7-generic{ap} linux-image-2.6.27-9-generic{p}
linux-image-generic{p}
0 packages upgraded, 0 newly installed, 3 to remove and 135 not upgraded.
Need to get 0B of archives. After unpacking 189MB will be freed.
The following packages have unmet dependencies:
linux-restricted-modules-2.6.27-9-generic: Depends: linux-image-2.6.27-9-generic but it is not installable
The following actions will resolve these dependencies:

Remove the following packages:
linux-restricted-modules-2.6.27-9-generic
linux-restricted-modules-generic

Score is 188

Accept this solution? [Y/n/q/?] y
The following packages will be REMOVED:
linux-image-2.6.27-7-generic{ap} linux-image-2.6.27-9-generic{p}
linux-image-generic{p} linux-restricted-modules-2.6.27-9-generic{a}
linux-restricted-modules-generic{a}
0 packages upgraded, 0 newly installed, 5 to remove and 134 not upgraded.
Need to get 0B of archives. After unpacking 191MB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
(Reading database ... 115710 files and directories currently installed.)
Removing linux-image-2.6.27-7-generic ...
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.27-12-generic
Found kernel: /boot/vmlinuz-2.6.27-9-generic
Found kernel: /boot/memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

Purging configuration files for linux-image-2.6.27-7-generic ...
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.27-12-generic
Found kernel: /boot/vmlinuz-2.6.27-9-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

rmdir: failed to remove `/lib/modules/2.6.27-7-generic': Directory not empty

dpkg - warning: while removing linux-image-2.6.27-7-generic, directory `/lib/modules/2.6.27-7-generic' not empty so not removed.
Removing linux-image-generic ...
(Reading database ... 115706 files and directories currently installed.)
Removing linux-restricted-modules-generic ...
Removing linux-restricted-modules-2.6.27-9-generic ...
update-initramfs: Generating /boot/initrd.img-2.6.27-9-generic
(Reading database ... 115645 files and directories currently installed.)
Removing linux-image-2.6.27-9-generic ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/last-good-boot
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.27-12-generic
Found kernel: /boot/memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
you may need to re-run your boot loader[grub]
Purging configuration files for linux-image-2.6.27-9-generic ...
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.27-12-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

rmdir: failed to remove `/lib/modules/2.6.27-9-generic': Directory not empty

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done

Current status: 134 updates [-2].

看红色部分
为什么会这样

代码: 全选

rodren@rodren:~$ dpkg --get-selections|grep linux
libselinux1					install
linux-firmware					install
linux-headers-2.6.27-9				install
linux-headers-2.6.27-9-generic			install
linux-headers-generic				install
linux-image-2.6.27-12-generic			install
linux-libc-dev					install
linux-restricted-modules-2.6.27-12-generic	install
linux-restricted-modules-2.6.27-7-generic	deinstall
linux-restricted-modules-2.6.27-9-generic	deinstall
linux-restricted-modules-common			install
linux-sound-base				install
linuxfetion					install
syslinux					install
util-linux					install
rodren@rodren:~$ 
头像
lyp069
帖子: 272
注册时间: 2005-10-25 13:54
联系:

Re: 怎么删除不了这个内核的东西

#2

帖子 lyp069 » 2009-04-11 17:19

linux-restricted-modules-2.6.27-9-generic 已损坏,请先卸掉他。出错的原因是因为/lib/modules/2.6.27-9-generic目录非空。也就是说损坏的linux-restricted-modules-2.6.27-9-generic并没有被卸掉或者是有残留文件存在。导致卸载失败。请先修复linux-restricted-modules-2.6.27-9-generic,然后卸掉linux-restricted-modules-2.6.27-7-generic.最后卸掉内核。
Full Circle中文杂志 | Ubuntu社区独立发行的电子月刊
http://www.freeearth.org.cn
头像
rodren
帖子: 100
注册时间: 2007-11-23 12:54
联系:

Re: 怎么删除不了这个内核的东西

#3

帖子 rodren » 2009-04-14 11:40

谢谢LS
回复