Ubuntu 修复依赖性问题

Ubuntu 修复依赖性问题

我遇到了依赖问题。每当我运行apt-get install命令时,我都会得到此错误信息

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1337 not upgraded.
7 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.103ubuntu0.7) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.8.0-19-generic (3.8.0-19.30) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-29-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-19-generic /boot/vmlinuz-3.8.0-19-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-19-generic /boot/vmlinuz-3.8.0-19-generic
Error! echo
Your kernel headers for kernel 3.8.0-19-generic cannot be found at
/lib/modules/3.8.0-19-generic/build or /lib/modules/3.8.0-19-generic/source.
Error! echo
Your kernel headers for kernel 3.8.0-19-generic cannot be found at
/lib/modules/3.8.0-19-generic/build or /lib/modules/3.8.0-19-generic/source.
Error! echo
Your kernel headers for kernel 3.8.0-19-generic cannot be found at
/lib/modules/3.8.0-19-generic/build or /lib/modules/3.8.0-19-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-19-generic /boot/vmlinuz-3.8.0-19-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-19-generic
Warning: No support for locale: en_SG.utf8
cp: cannot stat ‘/module-files.d/libpango1.0-0.modules’: No such file or directory
cp: cannot stat ‘/modules/pango-basic-fc.so’: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-19-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-19-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-19-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-3.8.0-29-generic (3.8.0-29.42) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-19-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-29-generic /boot/vmlinuz-3.8.0-29-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-29-generic /boot/vmlinuz-3.8.0-29-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-29-generic /boot/vmlinuz-3.8.0-29-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-29-generic
Warning: No support for locale: en_SG.utf8
cp: cannot stat ‘/module-files.d/libpango1.0-0.modules’: No such file or directory
cp: cannot stat ‘/modules/pango-basic-fc.so’: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-29-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-29-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-29-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-3.8.0-29-generic:
 linux-image-extra-3.8.0-29-generic depends on linux-image-3.8.0-29-generic; however:
  Package linux-image-3.8.0-29-generic is not configured yet.
 
dpkg: error processing linux-image-extra-3.8.0-29-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.8.0-29-generic; however:
  Package linux-image-3.8.0-29-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-3.8.0-29-generic; however:
  Package linux-image-extra-3.8.0-29-generic is not configured yet.
 
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image:
 linux-image depends on linux-image-generic; however:
  Package linux-image-generic is not configured yet.
 
dpkg: error processing linux-image (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-3.8.0-19-generic:
 linux-image-extra-3.8.0-19-generic depends on linux-image-3.8.0-19-generic; however:
  Package linux-image-3.8.0-19-generic is not configured yet.
 
dpkg: error processing linux-image-extra-3.8.0-19-generic (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.8.0-27-generic
Warning: No support for locale: en_SG.utf8
cp: cannot stat ‘/module-files.d/libpango1.0-0.modules’: No such file or directory
cp: cannot stat ‘/modules/pango-basic-fc.so’: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-27-generic with 1.
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-3.8.0-19-generic
 linux-image-3.8.0-29-generic
 linux-image-extra-3.8.0-29-generic
 linux-image-generic
 linux-image
 linux-image-extra-3.8.0-19-generic
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经尝试过了:

  • apt-get clean,,,,updateupgradeinstall -f
  • dpkg --configure -a

我现在应该怎么做?

答案1

http://ftp.de.debian.org/debian/ sid mainDebian 操作系统,而不是 Ubuntu。你应该不是使用此存储库。您可以执行以下操作:

  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk

    • 这是为了备份您的sources.list文件。
  2. 用你最喜欢的编辑器打开/etc/apt/sources.list,然后删除一切,并使用适当的默认存储库重新填充它。获取它们的方法如下:

    • 到这里:http://repogen.simplylinux.ch/
    • 选择您的国家并发布。
    • 选择“Ubuntu 分支”框中的所有内容。
    • 选择“Ubuntu 更新”框中除“建议”选项之外的所有内容。
    • 选择“Ubuntu Partner Repos”框中的所有内容。
    • 选择“Ubuntu Extras Repos”框中的所有内容。
    • 向下滚动到最底部并点击生成列表。
    • 将第一个框的输出复制到您的sources.list文件中并保存。
  3. 按顺序运行以下命令:

    sudo apt-get clean
    sudo apt-get 更新
    sudo apt-get 安装 -f
    sudo dpkg-a--configure
    sudo apt-get dist-upgrade
    

    在此过程中,您可能会遇到一些错误。apt-get install -f应该尝试解决大多数问题,但我怀疑它不会解决所有问题。dpkg将尝试进一步配置软件包,尽管apt-get install -f默认情况下应该调用它。最后一个命令是完全升级您的系统,包括 Linux 内核,这是您从发布的日志中遇到的问题。我建议您在完成所有操作后再次运行以下命令:

    sudo apt-get 安装 -f
    sudo dpkg-a--configure
    

答案2

尝试这个命令。它对我有帮助。

apt remove package_name 

并击中Enter

然后尝试安装你想要的任何东西

答案3

apt-get当我尝试通过或安装时突然遇到了类似的问题dkpg -i

对我来说,这个诀窍就像错误消息输出中所建议的那样:

apt-get install -f

我推测,我最近的一次安装失败了,导致我的系统处于未满足依赖项的状态。运行上述程序安装了一些库,之后我就可以安装我的新软件了。

相关内容