apt install --fix-policy 实际上做什么?

apt install --fix-policy 实际上做什么?

我在 man 或其他文档中没有找到此信息。正如我所建议的,它可以恢复所有基本软件包,但真的可以吗?

$ apt install --fix-policy 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  account-plugin-facebook account-plugin-flickr gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 krb5-locales
  libpam-cap light-locker-settings python-psutil ubuntu-release-upgrader-gtk update-manager update-motd
  update-notifier
Suggested packages:
  python-psutil-doc
The following NEW packages will be installed:
  account-plugin-facebook account-plugin-flickr gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 krb5-locales
  libpam-cap light-locker-settings python-psutil ubuntu-release-upgrader-gtk update-manager update-motd
  update-notifier
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.

答案1

嗯,根据这个老的) 错误报告以及相关邮件列表帖子--fix-policy实际上是一个巧妙的选项,可以apt重新考虑已安装软件包的“推荐”依赖项。因此,最初如果您安装的软件包没有其推荐的软件包,则可以使用以下命令让它安装这些额外的软件包--fix-polcy

如果您想查看系统带有 --install-recommends 时会发生什么变化,请运行:

# apt-get install --fix-policy --install-recommends 

如果您想知道哪些包导致安装哪些推荐的包,请运行:

# apt-get install --fix-policy --install-recommends -o Debug::pkgDepCache::AutoInstall=true

这个选项已经存在了大约 11 年,并且要求将其包含在手册页中的错误报告也已经存在了 8 年。

因此,我得到例如:

$ sudo apt-get install --fix-policy -o Debug::pkgDepCache::AutoInstall=true
Reading package lists... Done
Building dependency tree
Reading state information... Done
  Installing iio-sensor-proxy as Recommends of gnome-settings-daemon
  Installing indicator-printers as Recommends of unity
  Installing cinnamon-l10n as Recommends of nemo
  Installing nemo-fileroller as Recommends of nemo
  Installing python-bs4 as Recommends of python-lxml

相关内容