什么是 dpkg-reconfigure,它与 dpkg --configure 有何不同?

Mat*_*att 25 apt dpkg

我最近得到了另一个问题帮助的答案:“aptd”正在最大化我的 CPU?其中包括运行命令

sudo dpkg-reconfigure -phigh -a 
Run Code Online (Sandbox Code Playgroud)

sudo dpkg --configure -a
Run Code Online (Sandbox Code Playgroud)

这一切似乎都很合理,但我对一些事情感到好奇。

dpkg-reconfigure这些-phigh -a标志是什么以及什么意思?

它与 有什么不同dpkg --configure

sou*_* c. 21

man dpkg

   --configure package...|-a|--pending
          Configure a package which has been unpacked but not yet  config?
          ured.   If  -a  or  --pending  is  given instead of package, all
          unpacked but unconfigured packages are configured.

          Configuring consists of the following steps:

          1.  Unpack  the  conffiles, and at the same time back up the old
          conffiles, so that they can be restored if something goes wrong.

          2. Run postinst script, if provided by the package.
Run Code Online (Sandbox Code Playgroud)

man dpkg-reconfigure

   dpkg-reconfigure - reconfigure an already installed package

   -pvalue, --priority=value
       Specify the minimum priority of question that will be displayed.
       dpkg-reconfigure normally shows low priority questions no matter
       what your default priority is. See debconf(7) for a list.

   -a, --all
       Reconfigure all installed packages that use debconf. Warning: this
       may take a long time.
Run Code Online (Sandbox Code Playgroud)

这里dpkg --configure -a将配置所有解压但未配置的包。而dpkg-reconfigure -phigh -a将重新配置所有使用debconf高优先级的已安装包。

  • 请注意,“-a”“--all”选项自 15.10 版本及更高版本起不可用,因为我发现尝试在 16.04 上使用它。http://askubuntu.com/questions/775328/is-dpkg-reconfigure-all-still-available-in-16-04 (4认同)
  • 不过我还是有点糊涂。那么 dpkg-reconfigure 在“重新配置”包时究竟对它做了什么?我在这个网站上看到了第一个答案,上面写着 dpkg-reconfigure:https://superuser.com/questions/1153203/ubuntu-17-04-systemd-resolved-dns-lookups-randomly-fail/1200745#1200745。重新配置 resolvconf 时会发生什么? (3认同)