由于 linux-restricted-modules-2.6.28-17-generic 包损坏,我无法在 Ubuntu 中安装新的包...
I get the following errors while installing any package....I had once been stupid enough to delete the /lib/modules/2.6.28-17 directory while removing the 2.6.28-17 kernel files, Instead of uninstalling it. Is there any way to rectify (work around) this problem...How would it be if I simply try to recreate the file structure in /var/lib/dpkg/info/linux-restricted-modules-2.6.28-17-generic.postrm, Just a suggestion, would it work??? Please help me out!!!
Removing linux-restricted-modules-2.6.28-17-generic ...
rmdir:无法删除“/lib/modules/2.6.28-17-generic/volatile/”:没有此文件或目录 FATAL:无法打开“/boot/System.map-2.6.28-17-generic”:没有此文件或目录 update-initramfs:正在生成 /boot/initrd.img-2.6.28-17-generic 找不到 /lib/modules/2.6.28-17-generic update-initramfs:/boot/initrd.img-2.6.28-17-generic 失败 dpkg:处理 linux-restricted-modules-2.6.28-17-generic 时出错(--remove):安装的子进程删除后脚本返回错误退出状态 1 处理时遇到错误:linux-restricted-modules-2.6.28-17-generic
E: 子进程 /usr/bin/dpkg 返回错误代码 (1)
非常感谢,Avinash。
答案1
当包prerm
或postrm
脚本失败时,最好的办法通常是编辑脚本/var/lib/dpkg/info
并注释掉(或有时调整)失败的行。您应该仔细检查这些行的作用,并尝试手动执行它们试图执行的操作。
就您而言,您已经删除了脚本尝试删除的文件,因此请注释掉失败的行/var/lib/dpkg/info/linux-restricted-modules-2.6.28-17-generic.postrm
并运行dpkg --remove linux-restricted-modules-2.6.28-17-generic
。
一旦删除了有问题的软件包,请运行apt-get -f install
以完成任何等待删除的软件包管理操作(安装、配置、删除等)。