Skip to content

Instantly share code, notes, and snippets.

@fedir

fedir/goUpgrade.sh

Last active Dec 23, 2019
Embed
What would you like to do?
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