简体   繁体   English

如果 apt-get --fix-broken 给我一个“未知”错误,我该如何修复损坏的依赖项?

[英]How do I fix broken dependencies if apt-get --fix-broken is giving me a "not known" error?

I've been attempting to install OpenLDAP on Ubuntu, but I keep receiving a dependency error whenever I try to install it.我一直在尝试在 Ubuntu 上安装 OpenLDAP,但是每当我尝试安装它时,我都会收到依赖项错误。

The console output is:控制台输出是:

dpkg: error processing package libapache2-mpm-itk (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apache2-mpm-itk:
 apache2-mpm-itk depends on libapache2-mpm-itk; however:
  Package libapache2-mpm-itk is not configured yet.

dpkg: error processing package apache2-mpm-itk (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.

Errors were encountered while processing:
 libapache2-mpm-itk
 apache2-mpm-itk

I tried running the code below to fix these errors:我尝试运行下面的代码来修复这些错误:

sudo apt-get -f

But I received the error:但我收到了错误:

E: Command line option 'f' [from -f] is not known.

I have also tried to use the alternative --fix-broken, but I get the same error.我也尝试使用替代方法 --fix-broken,但我遇到了同样的错误。 Has anyone ever experience this and know a way around this?有没有人经历过这个并且知道解决这个问题的方法?

First you'll have to resolve the problem with libapache2-mpm-itk .首先,您必须使用libapache2-mpm-itk解决问题。 There isn't enough info in what you posted above to see why it's failing to install, but a quick workaround would be to just remove it:您在上面发布的内容中没有足够的信息来了解它安装失败的原因,但一个快速的解决方法是将其删除:

sudo apt-get purge libapache2-mpm-itk apache2-mpm-itk

After that you should be able to install other packages again.之后,您应该能够再次安装其他软件包。

-f has to be used with an action, for example: sudo apt-get -f install (you don't need to provide any packages names when doing this.) -f必须与操作一起使用,例如: sudo apt-get -f install (执行此操作时不需要提供任何包名称。)

Whilst同时

sudo apt --fix-broken install

should work to repair damage.应该可以修复损坏。 You might also find你可能还会发现

sudo apt-get -f install

yeilds better result.产生更好的结果。 Even though it's meant to be same.即使它的意思是相同的。

您需要运行sudo apt-get -f install不仅仅是sudo apt-get -f

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM