dpkg: 处理包时出错

dpkg: 处理包时出错

我正在尝试在 ubuntu 14.04LTS 上安装 mongodbserver,参考mongodb 文档但出现与 dpkg 相关的错误

root@c3:~# apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mongodb-org is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-org-server (3.0.12) ...
start: Job failed to start
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mongodb-org:
 mongodb-org depends on mongodb-org-server; however:
  Package mongodb-org-server is not configured yet.

dpkg: error processing package mongodb-org (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mongodb-org-server
 mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)

到目前为止我已完成以下步骤:

apt-get purge mongodb-org*
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get update

答案1

正如 Spooler 的评论所指出的,重要的信息是这部分:

invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 1

作为软件包安装的一部分,dpkg将运行软件包提供的脚本。在本例中,软件包 mongodb-org-server 提供了一个在安装后运行的脚本(称为“安装后脚本”,它是各种脚本之一软件包维护者脚本包中可能包含的异常)。问题是,此脚本在运行时返回退出代码 1,表示失败。其他错误都是此失败的结果。

要解决此问题,您需要找出安装后脚本失败的原因,通常通过调试脚本来实现。有关如何执行此操作的更多信息,请参阅如何调试子进程安装后中的 dpkg configure 错误?在 askubuntu.com 上。

答案2

配置不正确,请尝试运行:

sudo dpkg-reconfigure -a

相关内容