sudo apt-get -f install到底能做什么?


41

我以前看过 我只是想知道它到底是做什么的?

Answers:


39

来自man apt-get

   -f, --fix-broken
       Fix; attempt to correct a system with broken dependencies in place. This
       option, when used with install/remove, can omit any packages to permit APT
       to deduce a likely solution. If packages are specified, these have to
       completely correct the problem. The option is sometimes necessary when
       running APT for the first time; APT itself does not allow broken package
       dependencies to exist on a system. It is possible that a system's dependency
       structure can be so corrupt as to require manual intervention (which usually
       means using dselect(1) or dpkg --remove to eliminate some of the offending
       packages). Use of this option together with -m may produce an error in some
       situations. Configuration Item: APT::Get::Fix-Broken.

19
A您可以为此感谢主。当您有一个破损的包裹时,就像在鞋子里放一块石头一样……而您正在马拉松比赛中……熊骑着鲨鱼骑着巨大的蜘蛛。但是,由于这些损坏的东西得以修复。
路易斯·阿尔瓦拉多

2
在偶尔仅靠sudo apt-get -f install自身不足以修复损坏的包裹的情况下,请参见此答案
伊利亚·卡根

只是作为补充-如果您改变主意package导致未满足的依赖关系,则只需sudo apt-get remove package消除未满足的依赖关系错误,而不安装修复中断的软件包。
user1953384 '16

1

这是我发现它非常有用的地方。我运行了dpkg命令来安装几个.deb软件包,但是由于缺少某些依赖项,安装失败。

然后我跑了

apt-get -f install

并且它完全安装了所需的依赖项。然后,我能够重新运行dpkg命令,一切正常。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.