“sudo dpkg --configure -a”到底起什么作用?

“sudo dpkg --configure -a”到底起什么作用?

我从我的 ubuntu 系统中卸载了 mGBA 模拟器,因为它无法正常工作。我尝试通过命令行卸载它,但遇到了这个错误。 dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 我运行了它sudo dpkg --configure -a,然后开始安装一堆随机的东西。

我对这些东西完全是菜鸟。我是不是搞乱了我的系统,或者安装了不该安装的东西,导致操作系统崩溃或存在漏洞?

谢谢!^_^

答案1

如果apt由于某种原因中断,已下载和解压的软件包可能尚未完全配置或安装。

man dpkg

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

          To reconfigure a package which has already been  configured,  try  the
          dpkg-reconfigure(8) command instead.

          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.

--configure选项使 dpkg 完成部分安装的软件包的配置,并且表示-a应该处理所有未解压但未配置的软件包,而不是特定的软件包。

相关内容