【发布时间】:2018-04-05 09:46:43
【问题描述】:
我发现 MongoDB 不支持 Ubuntu 的非 LTS 版本。我试过安装Ubuntu提供的非官方的mongodb包,但是安装不成功:
$ sudo apt install mongodb
[sudo] password for nabhoneel:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libboost-chrono1.62.0 libboost-program-options1.62.0 libgoogle-perftools4
libtcmalloc-minimal4 libunwind8 libyaml-cpp0.5v5 mongo-tools mongodb-clients
mongodb-server
The following packages will be REMOVED:
mongodb-org-server
The following NEW packages will be installed:
libboost-chrono1.62.0 libboost-program-options1.62.0 libgoogle-perftools4
libtcmalloc-minimal4 libunwind8 libyaml-cpp0.5v5 mongo-tools mongodb
mongodb-clients mongodb-server
0 upgraded, 10 newly installed, 1 to remove and 20 not upgraded.
Need to get 0 B/48.5 MB of archives.
After this operation, 183 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 288023 files and directories currently installed.)
Removing mongodb-org-server (3.0.15) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
subprocess installed pre-removal script returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试过这个方法:How to Install and Secure MongoDB 3.6 on Ubuntu 17.10 (on Medium.com)
那也没用。
我根本不是专家,但常见的问题似乎是启动 MongoDB 服务。但是,不安装服务怎么启动呢?
如果有人能帮我解决这个问题,那将非常有帮助,否则,我将不得不安装一些其他(官方)兼容的 Linux 版本。
【问题讨论】:
-
好像mongo.service无法停止,能否查看一下有没有关于mongo的进程
ps aux | grep mongo如果有的话kill掉重新安装试试 -
我已经将它安装在我的 17.10 ubuntu 服务器上,所以它是可行的。我不记得我是如何安装它的,我稍后会检查并在我可以访问服务器时发表评论。
-
@ArnoldGandarrilas 我试过了。我不知道为什么PID不断变化。我杀不了它。
-
@HRK44 好的。非常感谢!请做。
-
@NovoBook 我的错,我有 3.4 而不是 3.6!
标签: mongodb ubuntu-17.10