linux - Windows 10 Linux 子系统。如何安装 MongoDB

标签 linux windows bash mongodb ubuntu

最近发布了 Windows 10 周年更新的新更新,包括 Linux 子系统 based on Ubuntu 14.04而现在我希望我所有的工作环境都在这个 Linux 子系统中。

我尝试按照官方网站 https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ 的说明安装 MongoDB

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org

安装完成后,我尝试使用 mongodb 运行

sudo service mongodb start

但有跟随错误

User@DESKTOP-TPQIRNP:/mnt/c/Users/User$ sudo service mongod start
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
mongod: unrecognized service

如何安装最新稳定版的MongoDB才不会出错?

最佳答案

目前,我们可以在此处的 Microsoft/BashOnWindows 问题 https://github.com/Microsoft/BashOnWindows/issues/796 中看到一些解决此问题的方法

一种可行的解决方案https://github.com/Microsoft/BashOnWindows/issues/796#issuecomment-238048520

关于linux - Windows 10 Linux 子系统。如何安装 MongoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38798593/

相关文章:

linux - 什么时候 xargs 应该优先于 while-read 循环?

c++ - 向调用线程发出信号,表明资源已在使用中

java - 由于 "input line is too long",在 Windows 上运行 .bat 文件时出现问题

Linux shell : sed regex working with special char

c - 在客户端代码连接之前绑定(bind)

windows - Selenium Grid Hub 操作超时

bash - 采购后如何阻止 .bashrc 中的变量在 shell 中可见?

linux - 将syslog文件复制到linux中的新目录

mysql - 无需输入 mysql 命令行即可收集 mysql 查询结果

linux - rpm 文件中的文件类型