-
-
Save 0x003e/f543ae91e097a2368a2122e0d076e319 to your computer and use it in GitHub Desktop.
Install golang debian/ubuntu
This file contains hidden or 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
| #!/bin/bash | |
| export GOLANG_VERSION=1.7.1 | |
| export GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz | |
| apt-get update -qq | |
| apt-get install -y --no-install-recommends \ | |
| g++ \ | |
| gcc \ | |
| libc6-dev \ | |
| make \ | |
| git-core | |
| curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ | |
| && tar -C /usr/local -xzf golang.tar.gz \ | |
| && rm golang.tar.gz | |
| for bin in $(ls /usr/local/go/bin/); do | |
| test -f /usr/bin/$bin && rm /usr/bin/$bin | |
| update-alternatives --install /usr/bin/$bin $bin /usr/local/go/bin/$bin 1 | |
| update-alternatives --set $bin /usr/local/go/bin/$bin | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment