Skip to content

Instantly share code, notes, and snippets.

@fedir
Last active December 23, 2019 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedir/ed87c80cfcc95ad4a521bf51984c0b56 to your computer and use it in GitHub Desktop.
Save fedir/ed87c80cfcc95ad4a521bf51984c0b56 to your computer and use it in GitHub Desktop.
Go update script for Linux Mint / Ubuntu / Debian (and some other distributions)
#!/bin/bash
# Golang upgrade script
# (C) 2019, Fedir RYKHTIK
# Usage: define the version constants and use it under the account
# Define target constants
VERSION="1.13.5"
OS="linux"
ARCH="amd64"
# Check previous version
echo "Current \"go\" version:"
/usr/local/go/bin/go version
# Remove previous go version
rm -rf /usr/local/go/
# Install target version
cd /root/tmp/
wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
# Check new version
echo "Current \"go\" version:"
/usr/local/go/bin/go version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment