Last active
December 8, 2016 10:53
-
-
Save qnub/5a79b7726596df1641d44a9c3b95586c to your computer and use it in GitHub Desktop.
Init apt with proxy and install python2.7 for ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HTTP_PROXY=$1 | |
HTTPS_PROXY=$2 | |
if [ -z "$HTTPS_PROXY" ]; then | |
HTTPS_PROXY=$HTTP_PROXY | |
fi | |
sudo mkdir -p /etc/apt/apt.conf.d | |
sudo touch /etc/apt/apt.conf.d/30proxy | |
cat << EOF | sudo tee /etc/apt/apt.conf.d/30proxy | |
Acquire::http::Proxy "$HTTP_PROXY"; | |
Acquire::https::Proxy "$HTTPS_PROXY"; | |
EOF | |
sudo apt update && sudo apt install -y python2.7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment