prerequisites.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. set -x
  3. export DEBIAN_FRONTEND=noninteractive
  4. RETCODE=$(fw_exists fwbm_prereqs_installed)
  5. [ ! "$RETCODE" == 0 ] || { \
  6. echo "Prerequisites installed!";
  7. return 0;
  8. }
  9. # Use a more recent version of Mongo shell
  10. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
  11. echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
  12. # One -q produces output suitable for logging (mostly hides
  13. # progress indicators)
  14. sudo apt-get -yq update
  15. sudo apt-get -yq upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
  16. # WARNING: DONT PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
  17. sudo apt-get -qqy install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
  18. cmake build-essential automake `# Needed for building code` \
  19. curl wget unzip `# Common tools` \
  20. software-properties-common `# Needed for add-apt-repository` \
  21. git-core mercurial `# Version control systems` \
  22. libpcre3 libpcre3-dev libpcrecpp0 `# Regular expression support` \
  23. libssl-dev libcurl4-openssl-dev `# SSL libraries` \
  24. libmysqlclient-dev \
  25. mongodb-org-shell \
  26. libsqlite3-dev sqlite3 `# Database libraries` \
  27. zlib1g-dev python-software-properties \
  28. libreadline6-dev \
  29. libbz2-dev \
  30. libyaml-dev libxml2-dev \
  31. libxslt-dev libgdbm-dev ncurses-dev \
  32. libffi-dev htop libtool bison libevent-dev \
  33. libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
  34. liborc-0.4-0 libwxbase2.8-0 libwxgtk2.8-0 libgnutls-dev \
  35. libjson0-dev libmcrypt-dev libicu-dev gettext \
  36. libpq-dev mlton \
  37. libjemalloc-dev libluajit-5.1-dev `# Needed by lwan at least` \
  38. libhiredis-dev `# Redis client - Needed by ngx_mruby at least` \
  39. cloc dstat `# Collect resource usage statistics`
  40. # Install gcc-4.8
  41. sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  42. sudo apt-get -yq update
  43. sudo apt-get install -qqy gcc-4.8 g++-4.8
  44. # Stop permanently overwriting people's files just for
  45. # trying out our software!
  46. RETCODE=$(fw_exists ~/.bash_profile.bak)
  47. [ ! "$RETCODE" == 0 ] || { \
  48. echo "Backing up your original ~/.bash_profile, ~/.profile, ~/.bashrc"
  49. mv ~/.bash_profile ~/.bash_profile.bak || true
  50. mv ~/.profile ~/.profile.bak || true
  51. mv ~/.bashrc ~/.bashrc.bak || true
  52. }
  53. sudo sh -c "echo '* - nofile 65535' >> /etc/security/limits.conf"
  54. touch fwbm_prereqs_installed