Edit /etc/apt/sources.list
and add the following lines to the bottom of the file:
# MongoDB
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Then run the following commands:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo apt-get update
sudo mkdir -p /data/db/
sudo apt-get install mongodb-10gen