最近发布了 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/