你能帮我解决这个问题吗?我已经更新(apt-get升级)我的系统Debian GNU/Linux 7.6(喘息)但是对于磁盘空间问题手术失败。我释放了磁盘空间后,但 MongoDB 无法启动。我已经尝试了几种程序。
第一的apt-get --purge remove mongodb-org:
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
在/etc/init.d/
是:
mongod -> /lib/init/upstart-job
我删除了它,并将其替换为来自其他系统的其他 mongoDB 安装的 mongod。然后卸载就正确了。
我运行后apt-get install -y mongodb-org
但失败了:
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 100
Setting up MongoDB package-org-Mongos (2.6.4) ...
Setting up MongoDB package-org-tools (2.6.4) ...
dpkg: unmet dependencies prevent configuration package MongoDB-org:
MongoDB-org depends on MongoDB-org-server; but:
MongoDB package-org-server is not configured yet.
在/etc/init.d/
是:
mongod -> /lib/init/upstart-job
mongod.dpkg-bak
我删除了 mongod 并重命名mongod.dpkg-bak
为mongod
.然后安装就正确了。但 MongoDB 没有启动。
Reading package lists ... Done
It creates a 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 will be used to drive other 0 B.
Setting up MongoDB package-org-server (2.6.4) ...
[FAIL] Starting database: mongodb failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing MongoDB-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: unmet dependencies prevent configuration package MongoDB-org:
MongoDB-org depends on MongoDB-org-server; but:
MongoDB package-org-server is not configured yet.
dpkg: error processing MongoDB-org (--configure):
dependency problem - leave it unconfigured
Errors were encountered while processing:
MongoDB-org-server MongoDB-org E:子进程 /usr/bin/dpkg 返回错误代码 (1)
如果我跑service mongod start
:
[FAIL] Starting database: mongodb failed!
但/var/log/mongod/mongod.log
不包含此时的任何条目。非常感谢您的帮助。
dpkg-query -l“MongoDB-org *”输出:
+++-=================================-=====================-=====================-=======================================================================
iU mongodb-org 2.6.4 i386 MongoDB open source document-oriented database system (metapackage)
ii mongodb-org-mongos 2.6.4 i386 MongoDB sharded cluster query router
iF mongodb-org-server 2.6.4 i386 MongoDB database server
ii mongodb-org-shell 2.6.4 i386 MongoDB shell client
ii mongodb-org-tools 2.6.4 i386 MongoDB tools
un mongodb-org-unstable <none> (no description available)
un mongodb-org-unstable-mongos <none> (no description available)
un mongodb-org-unstable-server <none> (no description available)
un mongodb-org-unstable-shell <none> (no description available)
un mongodb-org-unstable-tools <none> (no description available)
dpkg --配置 mongodb-org-server mongodb-org:
Setting up mongodb-org-server (2.6.4) …
[FAIL] Starting database: mongodb failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: unmet dependencies prevent configuration package MongoDB-org:
MongoDB-org depends on MongoDB-org-server; but:
MongoDB package-org-server is not configured yet.
dpkg: error processing MongoDB-org (--configure):
dependency problem - leave it unconfigured
Errors were encountered while processing:
MongoDB-org-server
MongoDB-org
dpkg --configure --force-depends mongodb-org-server mongodb-org:
Setting up mongodb-org-server (2.6.4) …
[FAIL] Starting database: mongodb failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems, but configuring as per your requirement:
mongodb-org depends on mongodb-org-server; however:
MongoDB package-org-server is not configured yet.
Setting org-package MongoDB (2.6.4) ...
Errors were encountered while processing:
mongodb-org-server
答案1
选项1:
由于您似乎已半配置mongodb-org-server
并解压但(未配置)mongodb-org
,请尝试以下命令:
dpkg --configure mongodb-org-server mongodb-org
如果依赖问题也失败,请尝试以下操作:
dpkg --configure --force-depends mongodb-org-server mongodb-org
选项2:
由于在您的情况下软件包配置似乎没有完成,我建议接下来尝试清理以前安装的系统,然后进行全新安装。然而,以下是相当粗略的方法,我建议您首先阅读它并记住我还没有实际测试过它。
首先,获取 mongodb-org 软件包安装的文件列表:
dpkg-query -L mongodb-org mongodb-org-server mongodb-org-mongos mongodb-org-shell mongodb-org-tools | grep "^\/[^\.]" > mongo.files
然后,通过执行以下操作来验证内容mongo.files
(以确保它只包含可以删除的路径):
less mongo.files
然后,通过发出以下命令从系统中删除这些文件:
rm `cat mongo.files`
接下来是时候通过手动修改告诉包管理器这些包当前没有安装在系统中/var/lib/dpkg/status
。在对该文件执行任何操作之前,请对其进行备份,以防出现问题(请记住,我们正在对包管理器内部数据进行手术......)。该文件的格式为连续文本行的部分,各部分之间用空行分隔。找出文件中以 开头的所有部分Package: mongodb-org
并将其删除(删除从“Package”开始的行到空行的所有行)。完成后,保存文件并运行,apt-get update
然后运行apt-get install mongodb-org
.
我当然希望这不会破坏任何东西,并且最终您会得到 MongoDB 的功能副本。