Skip to content

Instantly share code, notes, and snippets.

@therealkenc
Last active May 9, 2019 06:21
Show Gist options
  • Save therealkenc/bcd8f51991c85a1df596bdc706b7912c to your computer and use it in GitHub Desktop.
Save therealkenc/bcd8f51991c85a1df596bdc706b7912c 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.

@lightyaer
Copy link

+1

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