| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # prevent any prompts when |
| 4 | # apt/yum installing tzdata |
| 5 | export DEBIAN_FRONTEND="noninteractive" |
| 6 | export TZ="Europe/London" |
| 7 | |
| 8 | apt-get install -y \ |
| 9 | build-essential \ |
| 10 | wget gpg \ |
| 11 | zlib1g \ |
| 12 | zlib1g-dev |
| 13 | |
| 14 | # software-properties-common (which provides the |
| 15 | # add-apt-repository command) cannot be installed on |
| 16 | # i386/20.04 due to broken package specifications. |
| 17 | # So here we add the deadsnakes repository by hand. |
| 18 | echo "deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ focal main" > /etc/apt/sources.list.d//deadsnakes-ubuntu-ppa-focal.list |
| 19 | echo "# deb-src https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu/ focal main" >> /etc/apt/sources.list.d//deadsnakes-ubuntu-ppa-focal.list |
| 20 | |
| 21 | wget -O - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xF23C5A6CF475977595C89F51BA6932366A755776" | \ |
| 22 | gpg --batch --yes --dearmor --output "/etc/apt/trusted.gpg.d/deadsnakes-ubuntu-ppa.gpg" |
| 23 | |
| 24 | apt-get update -y |
| 25 | apt-get install -y \ |
| 26 | python"$PYTHON_VERSION" \ |
| 27 | python"$PYTHON_VERSION"-dev \ |
| 28 | python${PYTHON_VERSION}-venv \ |
| 29 | python3-pip |