当我尝试使用该apt
命令时,它遇到错误。
例如,运行:
sudo apt-get autoremove
导致出现如下错误消息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-4.4.0-45-generic linux-image-extra-4.4.0-45-generic linux-image-extra-4.4.0-51-generic
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 379 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 384651 files and directories currently installed.)
Removing linux-image-extra-4.4.0-45-generic (4.4.0-45.66) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-45-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
WARNING: missing /lib/modules/4.4.0-45-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-45-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_vrF46u/lib/modules/4.4.0-45-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_vrF46u/lib/modules/4.4.0-45-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-45-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-45-generic (4.4.0-45.66) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-45-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-45-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-45-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-51-generic (4.4.0-51.72) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-51-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-45-generic
linux-image-4.4.0-45-generic
linux-image-extra-4.4.0-51-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试过跑步
sudo apt-get -f install
sudo dpkg --configure -a
sudo apt autoremove
sudo apt full-upgrade
并且所有这些命令都得到了类似或相同的错误。唯一有不同错误的是该sudo dpkg --configure -a
命令,它导致
Setting up linux-image-4.4.0-51-generic (4.4.0-51.72) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-4.4.0-51-generic
) points to /boot/initrd.img-4.4.0-51-generic
(/boot/initrd.img-4.4.0-51-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-4.4.0-51-generic
) points to /boot/vmlinuz-4.4.0-51-generic
(/boot/vmlinuz-4.4.0-51-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-51-generic
Found initrd image: /boot/initrd.img-4.4.0-51-generic
Found linux image: /boot/vmlinuz-4.4.0-47-generic
Found initrd image: /boot/initrd.img-4.4.0-47-generic
usage: paste [-h]
paste: error: unrecognized arguments: -s -d
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-51-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-signed-image-4.4.0-51-generic:
linux-signed-image-4.4.0-51-generic depends on linux-image-4.4.0-51-generic (= 4.4.0-51.72); however:
Package linux-image-4.4.0-51-generic is not configured yet.
dpkg: error processing package linux-signed-image-4.4.0-51-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-4.4.0-51-generic
linux-signed-image-4.4.0-51-generic
为了参考,输出uname -a
为:
Linux ubuntu 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
有什么方法可以挽救包裹系统吗?