How come I can not uninstall mongoDB?

4,919 views
Skip to first unread message

3ax3yth

unread,
Dec 23, 2011, 7:05:38 AM12/23/11
to mongodb-user
I installed mongoDB following the instructions step by step at Ubuntu
and Debian packages page here:

http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages

Then my file system root quickly ran out of space and I thought I
would uninstall mongo by

1. Running `sudo apt-get purge mongodb mongodb-server mongodb-clients
mongodb-dev`
2. Removing `deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart
dist 10gen` in my /etc/apt/sources.list file

To see if mongo was really gone I ran `mongo` and I got the mongo
shell:

MongoDB shell version: 2.0.2
connecting to: test
>

When I run `locate mongo` I get the following list

/etc/mongodb.conf
/etc/init/mongodb.conf
/etc/init.d/mongodb
/usr/bin/mongo
/usr/bin/mongod
/usr/bin/mongodump
/usr/bin/mongoexport
/usr/bin/mongofiles
/usr/bin/mongoimport
/usr/bin/mongorestore
/usr/bin/mongos
/usr/bin/mongostat
/usr/bin/mongotop
/usr/lib/openoffice/basis3.2/share/fingerprint/mongolian_cyrillic.lm
/usr/share/doc/mongodb-10gen
/usr/share/doc/mongodb-10gen/changelog.gz
/usr/share/doc/mongodb-10gen/copyright
/usr/share/lintian/overrides/mongodb-10gen
/usr/share/man/man1/mongo.1.gz
/usr/share/man/man1/mongod.1.gz
/usr/share/man/man1/mongodump.1.gz
/usr/share/man/man1/mongoexport.1.gz
/usr/share/man/man1/mongofiles.1.gz
/usr/share/man/man1/mongoimport.1.gz
/usr/share/man/man1/mongorestore.1.gz
/usr/share/man/man1/mongos.1.gz
/usr/share/man/man1/mongosniff.1.gz
/usr/share/man/man1/mongostat.1.gz
/usr/share/phpmyadmin/lang/mongolian-utf-8.inc.php
/usr/share/vim/vim72/keymap/mongolian_utf-8.vim
/var/lib/mongodb
/var/lib/dpkg/info/mongodb-10gen.conffiles
/var/lib/dpkg/info/mongodb-10gen.list
/var/lib/dpkg/info/mongodb-10gen.md5sums
/var/lib/dpkg/info/mongodb-10gen.postinst
/var/lib/dpkg/info/mongodb-10gen.postrm
/var/lib/dpkg/info/mongodb-10gen.preinst
/var/lib/dpkg/info/mongodb-10gen.prerm
/var/lib/mongodb/journal
/var/lib/mongodb/mongod.lock
/var/lib/mongodb/journal/j._0
/var/lib/mongodb/journal/prealloc.1
/var/lib/mongodb/journal/prealloc.2
/var/lib/update-rc.d/mongodb
/var/log/mongodb
/var/log/mongodb/mongodb.log



So how can I fully uninstall mongoDB?


Sam Millman

unread,
Dec 23, 2011, 7:12:32 AM12/23/11
to mongod...@googlegroups.com
Does this do anything:

sudo apt-get remove mongodb-10gen

?



--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Tyler Brock

unread,
Dec 23, 2011, 12:30:20 PM12/23/11
to mongodb-user
apt-get --purge remove mongodb-10gen

As Sam pointed out, you missed a crucial part of that command :-)

-Tyler

On Dec 23, 7:12 am, Sam Millman <sam.mill...@gmail.com> wrote:
> Does this do anything:
>
> sudo apt-get remove mongodb-10gen
>
> ?
>
> On 23 December 2011 12:05, 3ax3yth <maxmyt...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I installed mongoDB following the instructions step by step at Ubuntu
> > and Debian packages page here:
>
> >http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
>
> > Then my file system root quickly ran out of space and I thought I
> > would uninstall mongo by
>
> > 1. Running `sudo apt-get purge mongodb mongodb-server mongodb-clients
> > mongodb-dev`
> > 2. Removing `debhttp://downloads-distro.mongodb.org/repo/ubuntu-upstart

3ax3yth

unread,
Dec 23, 2011, 1:19:15 PM12/23/11
to mongodb-user
Ok so I did `sudo apt-get --purge remove mongodb-10gen` and it worked
but I got this warning:

dpkg: warning: while removing mongodb-10gen, directory '/var/lib/
mongodb' not empty so not removed.

Not sure why it was not removed. Can I go ahead and remove that on my
own?

Sam Millman

unread,
Dec 23, 2011, 1:21:32 PM12/23/11
to mongod...@googlegroups.com
Yep, it does that. Just remove it, sometimes files not related to the install end up in that directory but its normally just meta files that can be deleted.

3ax3yth

unread,
Dec 23, 2011, 1:23:54 PM12/23/11
to mongodb-user
One other thing. When I do `locate mongo` I get the list below which
is similar to my original list. I thought using `apt-get purge` would
get rid of everything mongoDB on my system. Other than this list it
seems like mongodb is gone from my system because running `mongo` or
`mongod` results in:

The program 'mongod' is currently not installed. You can install it
by typing:
sudo apt-get install mongodb



// `locate mongo` bash output //

/etc/mongodb.conf
/etc/init/mongodb.conf
/etc/init.d/mongodb
/usr/bin/mongo
/usr/bin/mongod
/usr/bin/mongodump
/usr/bin/mongoexport
/usr/bin/mongofiles
/usr/bin/mongoimport
/usr/bin/mongorestore
/usr/bin/mongos
/usr/bin/mongostat
/usr/bin/mongotop
/usr/lib/openoffice/basis3.2/share/fingerprint/mongolian_cyrillic.lm
/usr/share/doc/mongodb-10gen

Tyler Brock

unread,
Dec 23, 2011, 3:24:33 PM12/23/11
to mongodb-user
The locate database isn't updated on the fly... Run sudo updatedb.

Try not to use locate in the future, find is a much better way to go
about locating things.

-Tyler
Reply all
Reply to author
Forward
0 new messages