How to delete an old version of mongodb and install the new one in cloud9 IDE?

让人想犯罪 __ 提交于 2020-05-13 14:54:47

问题


I'm using the cloud9 IDE and I'm trying to connect through the mongo shell to a mongodb instance running on mongolab. Mongolab now runs mongodb version 3.0 but cloud9 has version 2.6 installed.

I've tried following the instructions on the mongodb website for installing on ubuntu 14.04 using the mongodb binaries, and although all of the commands it instructed me to use were executed without errors, I didn't understand exactly what was happening, and when I checked the mongodb version with mongod --version it still said I was running the old version - 2.6.10

Can someone explain the steps to uninstall the old version and install the new version of mongodb in cloud9?


回答1:


The first thing you have to do is to remove the existing mongodb:

sudo apt-get remove mongodb* --purge

Then we can follow instructions from MongoDB docs.

  1. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
  2. echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
  3. sudo apt-get update
  4. sudo apt-get install -y mongodb-org

I hope this helps.



来源:https://stackoverflow.com/questions/33204739/how-to-delete-an-old-version-of-mongodb-and-install-the-new-one-in-cloud9-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!