Upgrading mongodb has no effect and still shows the old version

后端 未结 7 1499
说谎
说谎 2020-12-29 01:51

Following are the commands which I used to upgrade my mongodb version from 2.6.9 to latest, but its still showing me the previous version. Let me know what I am doing wrong

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 02:18

    I'm in the exact same situation, followed the exact same steps, and had the same issue.

    What worked for me was:

    Uninstalling:

    sudo service mongod stop
    sudo apt-get purge mongodb-org*
    

    Do NOT remove data directories - all your data will be lost if doing so.

    Note: Calling sudo apt-get purge mongodb-org* deletes the mongod.conf file. In case you want to keep this file after the update, make sure you create a backup copy of it and use it after the new version has been installed.

    Then install mongodb with:

    sudo apt-get install -y mongodb-org
    

    This assumes that you've already performed the previous installation steps (importing the public key, creating a list file, reloading local package database) as you've stated.

提交回复
热议问题