Skip to content

Instantly share code, notes, and snippets.

@evdokimovm
Forked from therealkenc/WSL mondodb steps.md
Created August 7, 2016 08:49
Show Gist options
  • Save evdokimovm/526e9fb4a22893861e53ac4b8bfdf8f2 to your computer and use it in GitHub Desktop.
Save evdokimovm/526e9fb4a22893861e53ac4b8bfdf8f2 to your computer and use it in GitHub Desktop.

If you are still on Trusty you'll need a modern gcc toolchain.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get install build-essential git scons libssl-dev gcc-6 g++-6 
sudo apt-get install libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev
sudo apt-get install python-pymongo 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 1
gcc --version

Grab mongo and apply patch:

git clone https://github.com/mongodb/mongo.git
cd mongo
git checkout tags/r3.3.9
wget https://goo.gl/RkXL2j -O - | patch -p1  # or just apply the diff manually

Then build:

scons -j 4 core
sudo scons --prefix=/opt/mongo install
export PATH=/opt/mongo/bin:$PATH

The build takes a while on my crappy spinning disk machine but does complete. Basic mongo shell operations seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment