如何显示所有 apt-get Dpkg::Options 及其当前值?

如何显示所有 apt-get Dpkg::Options 及其当前值?

apt-get -o Dpkg::Options::="--force-confnew"

apt-get -o Dpkg::Options::="--force-confold"

还有很多。

我如何获取所有列表Dpkg::Options及其当前设置的值?

答案1

不幸的是,apt-config dump没有列出您正在寻找的 dpkg 选项。man dpkg帮助我找到了这个命令,--force-help它更具体地针对force您感兴趣的特定 dpkg 选项,但不是完整的选项列表:

$ dpkg --force-help
dpkg forcing options - control behaviour when problems found:
  warn but continue:  --force-<thing>,<thing>,...
  stop with error:    --refuse-<thing>,<thing>,... | --no-force-<thing>,...
 Forcing things:
  [!] all                Set all force options
  [*] downgrade          Replace a package with a lower version
      configure-any      Configure any package which may help this one
      hold               Process incidental packages even when on hold
      not-root           Try to (de)install things even when not root
      bad-path           PATH is missing important programs, problems likely
      bad-verify         Install a package even if it fails authenticity check
      bad-version        Process even packages with wrong versions
      overwrite          Overwrite a file from one package with another
      overwrite-diverted Overwrite a diverted file with an undiverted version
  [!] overwrite-dir      Overwrite one package's directory with another's file
  [!] unsafe-io          Do not perform safe I/O operations when unpacking
  [!] confnew            Always use the new config files, don't prompt
  [!] confold            Always use the old config files, don't prompt
  [!] confdef            Use the default option for new config files if one
                         is available, don't prompt. If no default can be found,
                         you will be prompted unless one of the confold or
                         confnew options is also given
  [!] confmiss           Always install missing config files
  [!] confask            Offer to replace config files with no new versions
  [!] architecture       Process even packages with wrong or no architecture
  [!] breaks             Install even if it would break another package
  [!] conflicts          Allow installation of conflicting packages
  [!] depends            Turn all dependency problems into warnings
  [!] depends-version    Turn dependency version problems into warnings
  [!] remove-reinstreq   Remove packages which require installation
  [!] remove-essential   Remove an essential package

WARNING - use of options marked [!] can seriously damage your installation.
Forcing options marked [*] are enabled by default.

答案2

可以使用。

apt-config dump

答案3

简短回答: dpkg --force-help

我不同意接受的答案。虽然 apt-config dump 有助于查看一些当前启用的选项 - 其中许多选项通常用于简单的 apt 操作 - 但它不会显示 dpkg 操作的所有选项,即原始问题所指的“强制”选项。要查看默认情况下启用哪些附加选项,以及哪些选项应仅在完全必要时由知情用户更改,必须使用提供的帮助(来自 CLI) 。dpkg 的手册页在描述命令标志dpkg --force-help的部分下提供了此标志输出的简短说明。此手册页也可以在线查看: --force-*things*dpkghttp://man7.org/linux/man-pages/man1/dpkg.1.html https://linux.die.net/man/1/dpkg (这些只是几个地点)。

相关内容