程序包管理器失败

程序包管理器失败

关注后此主题到最后,这个问题还没有从技术上得到解决(用户刚刚购买了一台新电脑),我只能悬而未决。

我认为我的包管理器要么只安装了一半,要么没有安装,要么就是坏了。我认为应该采取的方法是使用 LiveUSB(Ubuntu 14.04.5)来安装它。我不确定该怎么做。

注意:所有 apt-get install/purge/remove/etc. 命令都会返回类似的错误,因此我无法安装 linux-headers-3.13.0-100-generic 包。

以下是该线程的一些请求命令的输出:

mcordaro@HAL9000L:/$ sudo apt-get install -f -y
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  linux-image-extra-3.13.0-100-generic linux-image-extra-3.13.0-112-generic
  linux-image-extra-3.13.0-95-generic
0 upgraded, 0 newly installed, 3 to remove and 280 not upgraded.
3 not fully installed or removed.
After this operation, 456 MB disk space will be freed.
(Reading database ... 472475 files and directories currently installed.)
Removing linux-image-extra-3.13.0-100-generic (3.13.0-100.147) ...
depmod: ERROR: could not open directory /lib/modules/3.13.0-100-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-100-generic /boot/vmlinuz-3.13.0-100-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-100-generic /boot/vmlinuz-3.13.0-100-generic
dkms: WARNING: Linux headers are missing, which may explain the above failures.
      please install the linux-headers-3.13.0-100-generic package to fix this.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-100-generic /boot/vmlinuz-3.13.0-100-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-100-generic
grep: /boot/config-3.13.0-100-generic: No such file or directory
WARNING: missing /lib/modules/3.13.0-100-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.13.0-100-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: 0r§mûü…ooEhttps://console.aws.amazon.com/p/log/1/lambda/1/OP/: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ØA
—Eoúô: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ˆ¹ù+œ.£^»ù+œ.HTTP/1.1: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: 0r§mûü…ooEhttps://console.aws.amazon.com/p/log/1/lambda/1/OP/: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: /usr/share/initramfs-
ools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ˆ¹ù+œ.£^»ù+œ.HTTP/1.1: not found
E: /usr/share/initramfs-tools/hooks/ntfs_3g failed with return 127.
update-initramfs: failed for /boot/initrd.img-3.13.0-100-generic with 127.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-3.13.0-100-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.13.0-112-generic (3.13.0-112.159) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-112-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-112-generic /boot/vmlinuz-3.13.0-112-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-112-generic /boot/vmlinuz-3.13.0-112-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-112-generic /boot/vmlinuz-3.13.0-112-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-112-generic
grep: /boot/config-3.13.0-112-generic: No such file or directory
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: 0r§mûü…ooEhttps://console.aws.amazon.com/p/log/1/lambda/1/OP/: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ØA
—Eoúô: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ˆ¹ù+œ.£^»ù+œ.HTTP/1.1: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: 0r§mûü…ooEhttps://console.aws.amazon.com/p/log/1/lambda/1/OP/: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ØA
—Eoúô: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ˆ¹ù+œ.£^»ù+œ.HTTP/1.1: not found
E: /usr/share/initramfs-tools/hooks/ntfs_3g failed with return 127.
update-initramfs: failed for /boot/initrd.img-3.13.0-112-generic with 127.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-3.13.0-112-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.13.0-95-generic (3.13.0-95.142) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-95-generic /boot/vmlinuz-3.13.0-95-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-95-generic /boot/vmlinuz-3.13.0-95-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-95-generic /boot/vmlinuz-3.13.0-95-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-95-generic
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: 0r§mûü…ooEhttps://console.aws.amazon.com/p/log/1/lambda/1/OP/: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: /usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ˆ¹ù+œ.£^»ù+œ.HTTP/1.1: not found
ØA
—Eoúô: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: 0r§mûü…ooEhttps://console.aws.amazon.com/p/log/1/lambda/1/OP/: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ØA
—Eoúô: not found
/usr/share/initramfs-tools/hooks/ntfs_3g: 1: /etc/default/ntfs-3g: ˆ¹ù+œ.£^»ù+œ.HTTP/1.1: not found
E: /usr/share/initramfs-tools/hooks/ntfs_3g failed with return 127.
update-initramfs: failed for /boot/initrd.img-3.13.0-95-generic with 127.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-3.13.0-95-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.13.0-100-generic
 linux-image-extra-3.13.0-112-generic
 linux-image-extra-3.13.0-95-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
mcordaro@HAL9000L:/$ dpkg --list | grep linux-image-extra*
rH  linux-image-extra-3.13.0-100-generic        3.13.0-100.147                          amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
rH  linux-image-extra-3.13.0-112-generic        3.13.0-112.159                          amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
rH  linux-image-extra-3.13.0-95-generic         3.13.0-95.142                           amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
mcordaro@HAL9000L:/$ dpkg --list | grep linux-image-3.13.0-*
rc  linux-image-3.13.0-100-generic              3.13.0-100.147                          amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-112-generic              3.13.0-112.159                          amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-24-generic               3.13.0-24.47                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-27-generic               3.13.0-27.50                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-29-generic               3.13.0-29.53                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-39-generic               3.13.0-39.66                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-43-generic               3.13.0-43.72                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-45-generic               3.13.0-45.74                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-52-generic               3.13.0-52.86                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-54-generic               3.13.0-54.91                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-57-generic               3.13.0-57.95                            amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-61-generic               3.13.0-61.100                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-62-generic               3.13.0-62.102                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-63-generic               3.13.0-63.103                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-65-generic               3.13.0-65.106                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-66-generic               3.13.0-66.108                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-76-generic               3.13.0-76.120                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc  linux-image-3.13.0-85-generic               3.13.0-85.129                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-95-generic               3.13.0-95.142                           amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP

请注意,我曾尝试在https://ubuntuforums.org但我提交时一直收到 Apache 403 错误。

答案1

你的包管理器没有任何问题。

类似这样的问题通常发生在人类提出一个不可能实现的要求,而系统却勇敢地尝试去服从的时候。

逐行仔细阅读错误消息。错误消息通常会告诉您问题是什么。

这是要修复的第一个问题。请注意,错误消息会告诉您如何修复它。

depmod: ERROR: could not open directory /lib/modules/3.13.0-100-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-100-generic /boot/vmlinuz-3.13.0-100-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-100-generic /boot/vmlinuz-3.13.0-100-generic
dkms: WARNING: Linux headers are missing, which may explain the above failures.
  please install the linux-headers-3.13.0-100-generic package to fix this.

没有这样的文件或目录当用户手动删除软件包管理器放置的文件时,就会发生错误。这是不明智的做法 - 它会破坏您的系统,正如您所发现的。

由于您似乎希望删除该软件包,您可以创建一个虚拟文件或目录供软件包管理器删除,或者您可以先重新安装该软件包。

相关内容