Skip to content

Instantly share code, notes, and snippets.

@Matthew-McRaven
Last active November 1, 2019 17:22
Show Gist options
  • Save Matthew-McRaven/84fd47bcd2f135c4a7434adc0e2e387a to your computer and use it in GitHub Desktop.
Save Matthew-McRaven/84fd47bcd2f135c4a7434adc0e2e387a to your computer and use it in GitHub Desktop.
Install dependencies of racecar
## If sudo is not available on the system,
## uncomment the line below to install it
# apt-get install -y sudo
sudo apt-get update -y
## Install prerequisites
sudo apt-get install curl gnupg -y
## Install RabbitMQ signing key
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
## Install apt HTTPS transport
sudo apt-get install apt-transport-https
## Add Bintray repositories that provision latest RabbitMQ and Erlang 21.x releases
sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
## Installs the latest Erlang 21.x release.
## Change component to "erlang" to install the latest version (22.x or later).
## "bionic" as distribution name should work for any later Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang-21.x
deb https://dl.bintray.com/rabbitmq/debian bionic main
EOF
## Update package indices
sudo apt-get update -y
## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
## Default path is localhost:15672, username:guest, password:guest
if hash java -version 2>/dev/null; then
(
sudo apt install openjdk-8-jre-headless
sudo apt install openjdk-8-jdk-headless
)
fi
## Enable web management interface for RabbitMQ
sudo rabbitmq-plugins enable rabbitmq_management
# Tensor flow needs Python 3.6, attempt to install the package if it exists.
sudo apt-get -y install python3.6
# Check if python3.6 command exists. If so, we may use it.
if hash python3.6 2>/dev/null; then
(
# Install Pip
# https://stackoverflow.com/questions/42662104/how-to-install-pip-for-python-3-6-on-ubuntu-16-10
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py
rm get-pip.py
echo "Using system default python"
)
# The system does not have python 3.6 available, so we have to build it.
else
(
# Dependencies of Python3.6.9
sudo apt-get -y install git build-essential checkinstall zlib1g-dev curl
sudo apt-get -y install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
# Dependencies needed to build python extensions (curses, ssl)
sudo apt-get -y install openssl libssl-dev libncurses5-dev
#Clone python 3.6 source code and build from source
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar xzf Python-3.6.9.tgz
rm Python-3.6.9.tgz
(
cd Python-3.6.9
# Gist contains a proper Setup.dist for Python 3.6.9, enables all needed extensions.
curl https://gist.githubusercontent.com/Matthew-McRaven/bd99e1f4add2bacf39e30ce0d18bb90f/raw/f01926df78ecfc39e6c3c77121ebfb65d7cf1c38/Setup.dist > Modules/Setup.dist
./configure --enable-optimizations
make -j4
# Install python as python3.6
sudo make altinstall
)
# Optionally remove python build directory
#rm -rf Python-3.6.9
)
fi
# Install dependency management packages
# Needs sudo since python is installed in system root.
sudo pip3.6 install --upgrade pip
sudo pip3.6 install virtualenv
sudo pip3.6 install setuptools==41.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment