软件包损坏(无法安装软件)

软件包损坏(无法安装软件)

我正在尝试安装 LAME mp3 解码器但出现了此问题...

sudo apt-get install lame
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-extra-4.4.0-141-generic
The following NEW packages will be installed
  lame
0 to upgrade, 1 to newly install, 1 to remove and 413 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/45.7 kB of archives.
After this operation, 156 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 288262 files and directories currently installed.)
Removing linux-image-extra-4.4.0-141-generic (4.4.0-141.167) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-141-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-141-generic
WARNING: missing /lib/modules/4.4.0-141-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-141-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-141-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-141-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-141-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我在论坛上搜索并运行了这个命令......

sudo  dpkg -P --force-depends linux-image-4.4.0-141-generic
(Reading database ... 288262 files and directories currently installed.)
Removing linux-image-4.4.0-141-generic (4.4.0-141.167) ...
Purging configuration files for linux-image-4.4.0-141-generic (4.4.0-141.167) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic

尝试再次安装 LAME 我得到了相同的输出......

sudo apt-get install lame
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-extra-4.4.0-141-generic
The following NEW packages will be installed
  lame
0 to upgrade, 1 to newly install, 1 to remove and 413 not to upgrade.
3 not fully installed or removed.
Need to get 0 B/45.7 kB of archives.
After this operation, 156 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 288262 files and directories currently installed.)
Removing linux-image-extra-4.4.0-141-generic (4.4.0-141.167) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-141-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-141-generic
WARNING: missing /lib/modules/4.4.0-141-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-141-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-141-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-141-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-141-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我列出了 4.4.0-141 包并尝试清除但没有成功......

apt-cache pkgnames |grep 4.4.0-141
linux-headers-4.4.0-141
linux-image-4.4.0-141-generic
linux-cloud-tools-4.4.0-141-generic
linux-signed-image-4.4.0-141-generic
linux-cloud-tools-4.4.0-141-lowlatency
linux-cloud-tools-4.4.0-141
linux-tools-4.4.0-141
linux-signed-image-4.4.0-141-lowlatency
linux-headers-4.4.0-141-lowlatency
linux-image-extra-4.4.0-141-generic
linux-tools-4.4.0-141-generic
linux-tools-4.4.0-141-lowlatency
linux-image-4.4.0-141-lowlatency
linux-headers-4.4.0-141-generic

sudo apt-get purge `!!`
sudo apt-get purge `apt-cache pkgnames |grep 4.4.0-141`
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'linux-cloud-tools-4.4.0-141' is not installed, so not removed
Package 'linux-cloud-tools-4.4.0-141-generic' is not installed, so not removed
Package 'linux-cloud-tools-4.4.0-141-lowlatency' is not installed, so not removed
Package 'linux-headers-4.4.0-141' is not installed, so not removed
Package 'linux-headers-4.4.0-141-generic' is not installed, so not removed
Package 'linux-headers-4.4.0-141-lowlatency' is not installed, so not removed
Package 'linux-image-4.4.0-141-generic' is not installed, so not removed
Package 'linux-image-4.4.0-141-lowlatency' is not installed, so not removed
Package 'linux-signed-image-4.4.0-141-lowlatency' is not installed, so not removed
Package 'linux-tools-4.4.0-141' is not installed, so not removed
Package 'linux-tools-4.4.0-141-generic' is not installed, so not removed
Package 'linux-tools-4.4.0-141-lowlatency' is not installed, so not removed
The following packages will be REMOVED
  linux-image-extra-4.4.0-141-generic linux-signed-image-4.4.0-141-generic*
0 to upgrade, 0 to newly install, 2 to remove and 413 not to upgrade.
3 not fully installed or removed.
After this operation, 156 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 288262 files and directories currently installed.)
Removing linux-image-extra-4.4.0-141-generic (4.4.0-141.167) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-141-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-141-generic /boot/vmlinuz-4.4.0-141-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-141-generic
WARNING: missing /lib/modules/4.4.0-141-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-141-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-141-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-141-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-141-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我搜索了很多次,但只能找到包含我遇到的一些错误行的帖子。我无法尝试将所有内容链接在一起。我还尝试使用包管理器删除损坏的依赖项,但最终还是出现了相同的错误:E:子进程 /usr/bin/dpkg 返回错误代码 (1)

最后我尝试了这个,看看它会产生什么结果......

ls -al /boot
total 214512
drwxr-xr-x  4 root root     4096 Apr  2 19:59 .
drwxr-xr-x 25 root root     4096 Jan 19  2019 ..
-rw-r--r--  1 root root  1166991 Dec  4  2017 abi-3.13.0-137-generic
-rw-r--r--  1 root root  1168825 Jun 14  2018 abi-3.13.0-153-generic
-rw-r--r--  1 root root  1169147 Dec  5  2018 abi-3.13.0-164-generic
-rw-r--r--  1 root root  1164671 May 20  2015 abi-3.13.0-53-generic
-rw-r--r--  1 root root   166050 Dec  4  2017 config-3.13.0-137-generic
-rw-r--r--  1 root root   166136 Jun 14  2018 config-3.13.0-153-generic
-rw-r--r--  1 root root   166221 Dec  5  2018 config-3.13.0-164-generic
-rw-r--r--  1 root root   165762 May 20  2015 config-3.13.0-53-generic
drwxr-xr-x  4 root root     4096 Jan  1  1970 efi
drwxr-xr-x  5 root root     4096 Mar 18 14:42 grub
-rw-r--r--  1 root root 30940994 Dec 20  2017 initrd.img-3.13.0-137-generic
-rw-r--r--  1 root root 30184136 Dec 31  2018 initrd.img-3.13.0-153-generic
-rw-r--r--  1 root root 31778569 Jan 16  2019 initrd.img-3.13.0-164-generic
-rw-r--r--  1 root root 30801564 Dec 20  2017 initrd.img-3.13.0-53-generic
-rw-r--r--  1 root root 29409680 Nov 22  2017 initrd.img-3.13.0-53-generic.old-dkms
-rw-r--r--  1 root root   182704 Jan 28  2016 memtest86+.bin
-rw-r--r--  1 root root   184380 Jan 28  2016 memtest86+.elf
-rw-r--r--  1 root root   184840 Jan 28  2016 memtest86+_multiboot.bin
-rw-r--r--  1 root root      691 Jun 14  2018 retpoline-3.13.0-153-generic
-rw-r--r--  1 root root      254 Dec  5  2018 retpoline-3.13.0-164-generic
-rw-------  1 root root  3400567 Dec  4  2017 System.map-3.13.0-137-generic
-rw-------  1 root root  3414641 Jun 14  2018 System.map-3.13.0-153-generic
-rw-------  1 root root  3417774 Dec  5  2018 System.map-3.13.0-164-generic
-rw-------  1 root root  3390132 May 20  2015 System.map-3.13.0-53-generic
-rw-------  1 root root  5852400 Dec  4  2017 vmlinuz-3.13.0-137-generic
-rw-------  1 root root  5854328 Dec 20  2017 vmlinuz-3.13.0-137-generic.efi.signed
-rw-------  1 root root  5893168 Jun 14  2018 vmlinuz-3.13.0-153-generic
-rw-------  1 root root  5895096 Aug 12  2018 vmlinuz-3.13.0-153-generic.efi.signed
-rw-------  1 root root  5905712 Dec  5  2018 vmlinuz-3.13.0-164-generic
-rw-------  1 root root  5907640 Jan 10  2019 vmlinuz-3.13.0-164-generic.efi.signed
-rw-------  1 root root  5821152 May 20  2015 vmlinuz-3.13.0-53-generic
-rw-------  1 root root  5823064 Dec 20  2017 vmlinuz-3.13.0-53-generic.efi.signed

任何帮助都将不胜感激。谢谢

相关内容