我试图使用 Synaptic 删除旧内核,但出了点问题。现在,如果我尝试修复它,我会在 Synaptic 中收到此错误:
(synaptic:11810): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
dpkg: warning: files list file for package 'refind' missing; assuming package has no files currently installed
(Reading database ... 338732 files and directories currently installed.)
Removing linux-image-extra-3.19.0-21-generic (3.19.0-21.21) ...
depmod: FATAL: could not load /boot/System.map-3.19.0-21-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-21-generic /boot/vmlinuz-3.19.0-21-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.19.0-21-generic /boot/vmlinuz-3.19.0-21-generic
Error! Your kernel headers for kernel 3.19.0-21-generic cannot be found.
Please install the linux-headers-3.19.0-21-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-21-generic /boot/vmlinuz-3.19.0-21-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-21-generic
grep: /boot/config-3.19.0-21-generic: No such file or directory
cp: cannot stat ‘/lib/modules/3.19.0-21-generic/kernel/drivers/hid/usbhid/usbhid.ko’: No such file or directory
modinfo: ERROR: Module /lib/modules/3.19.0-21-generic/kernel/drivers/hid/usbhid/usbhid.ko not found.
每当我尝试在终端中安装或更新时,都会收到一串完整的错误,并以以下结尾:
cp: cannot stat ‘/lib/modules/3.19.0-22-generic/kernel/drivers/firewire/firewire-sbp2.ko’: No such file or directory
modinfo: ERROR: Module /lib/modules/3.19.0-22-generic/kernel/drivers/firewire/firewire-sbp2.ko not found.
cp: cannot stat ‘/lib/modules/3.19.0-22-generic/kernel/ubuntu/aufs/aufs.ko’: No such file or directory
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.19.0-22-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.19.0-22-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.19.0-21-generic
linux-image-extra-3.19.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Synaptic 说我需要安装linux-headers-3.19.0-22-generic
软件包,但是当我在终端中尝试时,它说Package 'linux-headers-3.19.0-22-generic' has no installation candidate
.
我跑了sudo dpkg --audit
,它给出了以下内容:
The following packages are only half installed, due to problems during
installation. The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
linux-image-extra-3.19.0-21-generic Linux kernel extra modules for version 3.1
linux-image-extra-3.19.0-22-generic Linux kernel extra modules for version 3.1
显然,我搞砸了。Synaptic 不会修复它,也sudo apt-get install -f
不会sudo dpkg --configure -a
提供帮助。我不知道该怎么办!帮助??!?
我通过以下方式手动修复它:
第 1 步:
第2步:
然后我跑了一个
sudo apt-get update
andsudo apt-get upgrade
。现在一切正常!