2

I used the following to remove all mongodb packages so I can start fresh, but it does not seem to be working. How can I totally remove mongodb?

I did:

sudo apt-get autoremove mongodb-*
sudo apt-get purge mongodb mongodb-clients mongodb-server mongodb-dev

None of all that works. When I do mongod --version I still get:

db version v2.6.10
2017-10-01T00:20:56.172-0400 git version: nogitversion
2017-10-01T00:20:56.172-0400 OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016

When I run dpkg -S $(which mongod) I get the following:

mongodb-server: /usr/bin/mongod

The same for mongo.

Zanna
  • 70,465
mo_maat
  • 161
  • 1
  • "autoremove" is run "as is", without arguments, and is not for uninstalling software, just clean up old kernels and orphaned packages. 2. sudo apt-get purge mongodb* should work if and only if mongodb was installed with apt. Was it?
  • –  Oct 01 '17 at 04:28
  • I get this error when I run that: dpkg-query: error: --search needs at least one file name pattern argument – mo_maat Oct 01 '17 at 05:32
  • There was a typo so I ran this: dpkg -S $(which mongod) and got the following: mongodb-server: /usr/bin/mongod – mo_maat Oct 01 '17 at 05:43
  • I think I finally got it removed. Thanks Kaz. Your snippet pointed me to where to look and then I ran sudo apt-get purge mongodb-server. I still don't see why my original command did not do the same thing though. – mo_maat Oct 01 '17 at 06:01
  • 2
    If you got your issue solved please add an answer below with the necessary command(s) and accept by clicking the tick next to it. – dessert Oct 01 '17 at 06:07