From 2466040a3703474a52700defe4df53026b8c2005 Mon Sep 17 00:00:00 2001 From: Riley Evans Date: Wed, 21 Oct 2020 11:39:13 +0100 Subject: [PATCH] Bug-19: Fix ubuntu instructions --- go-install/linux.md | 49 +++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/go-install/linux.md b/go-install/linux.md index 4d6a2d6..1e54c17 100644 --- a/go-install/linux.md +++ b/go-install/linux.md @@ -1,26 +1,26 @@ # Personal Linux setup instructions -1. Check your Linux version by running `lsb_release -a` in the terminal. +## Option 1: Setup instructions for most Linux installations -2. If you have Ubuntu **20.04** use option 1, if you have arch Linux use option 2, for any other version (including Ubuntu 19.04/18.04/16.04) use option 3. - - -## Option 1: Setup instructions for Ubuntu 20.04 LTS (focal) +1. Run the following commands in terminal: -**Note: this is for Ubuntu 20.04 only. For older Ubuntu versions, use the "Setup instructions for other Linux installations" guide.** +```bash +wget https://dl.google.com/go/go1.15.3.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.15.3.linux-amd64.tar.gz +``` -1. Run the following commands in terminal. If bash is not your default shell, substitute `.bashrc` for the appropriate file (e.g. `.zshrc` for zsh). +2. Open your `.bashrc` file (`~/.bashrc`) in your editor of choice. Add the following lines to the bottom of the file: ```bash -sudo apt-get update -sudo apt-get install golang=2:1.13~1ubuntu2 --yes -echo 'export GOPATH="$HOME/go"' >> ~/.bashrc -echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc -source ~/.bashrc +export GOPATH="$HOME/go" +export PATH="$PATH:/usr/local/go/bin:$GOPATH/bin" ``` -2. Verify that `go version` shows a go installation of version `>=1.13`. +3. Save the file and exit. + +4. Close and re-open any terminal windows. +5. Verify your installation with the command `go version`. The version **will be `1.15.3`**. ## Option 2: Setup instructions for Arch Linux @@ -33,26 +33,5 @@ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc source ~/.bashrc ``` -2. Verify that `go version` shows a go installation of version `>=1.13`. - -## Option 3: Setup instructions for other Linux installations - -1. Run the following commands in terminal: - -```bash -wget https://dl.google.com/go/go1.15.1.linux-amd64.tar.gz -sudo tar -C /usr/local -xzf go1.15.1.linux-amd64.tar.gz -``` - -2. Open your `.bashrc` file (`~/.bashrc`) in your editor of choice. Add the following lines to the bottom of the file: - -```bash -export GOPATH="$HOME/go" -export PATH="$PATH:/usr/local/go/bin:$GOPATH/bin" -``` - -3. Save the file and exit. - -4. Close and re-open any terminal windows. +2. Verify that `go version` shows a go installation of version `>1.13.8`. -5. Verify your installation with the command `go version`. The version **will be `1.15.1`**.