我想在Debian上安装mongoDB。问题是当我尝试这样做时输出是这样的:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-10gen is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up mongodb-10gen (2.4.10) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
我搜索了一下,发现了一些解决方案,如:
install mongodb-10gen failed with apt-get
但是当尝试运行此命令时:
apt-get remove mongodb-clients
结果是:
[root@Takhalof-srv ~]$ apt-get remove mongodb-clients
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mongodb-clients' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-10gen (2.4.10) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我尝试运行此命令时:
sudo service mongodb restart
结果是:
mongodb: unrecognized service
当我使用apt-get -f install时,结果是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-10gen (2.4.10) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
我真的很困惑,不知道是什么问题。我该怎么办?
答案 0 :(得分:0)
第一个命令中的错误强烈暗示未安装MongoDB服务器(/ daemon)。尝试安装mongodb-server
,然后执行apt-get -f install
以完成配置任何一半已安装的软件包。