Skip to content

Instantly share code, notes, and snippets.

@tyagian
Created November 12, 2018 21:43
Show Gist options
  • Select an option

  • Save tyagian/479e7a73cee41b49fb8d6d41e306a34b to your computer and use it in GitHub Desktop.

Select an option

Save tyagian/479e7a73cee41b49fb8d6d41e306a34b to your computer and use it in GitHub Desktop.

Revisions

  1. tyagian created this gist Nov 12, 2018.
    31 changes: 31 additions & 0 deletions update-golang.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # How to update the Go version

    System: Debian/Ubuntu/Fedora. Might work for others as well.

    ### 1. Uninstall the exisiting version

    As mentioned [here](https://golang.org/doc/install#install), to update a go version you will first need to uninstall the original version.

    To uninstall, delete the `/usr/local/go` directory by:

    ```
    $ sudo rm -rf /usr/local/go
    ```

    ### 2. Install the new version

    Go to the [downloads](https://golang.org/dl/) page and download the binary release suitable for your system.

    ### 3. Extract the archive file

    To extract the archive file:

    ```
    $ sudo tar -C /usr/local -xzf /home/nikhita/Downloads/go1.8.1.linux-amd64.tar.gz
    ```

    ### 4. Make sure that your PATH contains `/usr/local/go/bin`

    ```
    $ echo $PATH | grep "/usr/local/go/bin"
    ```