Skip to content

Instantly share code, notes, and snippets.

@d2s
Last active July 8, 2024 18:13

Revisions

  1. d2s revised this gist Apr 5, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install-go-to-with-bash-script.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    NOTE: This is heavily outdated Gist snippet from 2017.

    -----

    # Install Go language with a Bash script

    Another alternative to installing Go is to use a simple Bash script.
  2. d2s revised this gist Dec 29, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install-go-to-with-bash-script.md
    Original file line number Diff line number Diff line change
    @@ -53,3 +53,4 @@ go help
    ```

    That should show a quick help for the `go` command.

  3. d2s revised this gist Dec 28, 2017. No changes.
  4. d2s revised this gist Dec 28, 2017. 1 changed file with 55 additions and 0 deletions.
    55 changes: 55 additions & 0 deletions install-go-to-with-bash-script.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    # Install Go language with a Bash script

    Another alternative to installing Go is to use a simple Bash script.
    It will download and install Go language under of your own user account.

    Note that a system-wide installation might be better for some things
    (for example, better protected from accidental modifications etc.),
    but this was a bit simpler to setup.

    For this example, we are using:
    - https://github.com/canha/golang-tools-install-script


    ## Create directory

    ```sh
    mkdir -p ~/git/GitHub/canha
    ```

    ## Clone Git repository

    ```sh
    cd ~/git/GitHub/canha
    git clone https://github.com/canha/golang-tools-install-script
    cd golang-tools-install-script/
    ```

    ## Install a 64-bit version

    ```sh
    bash goinstall.sh --64
    ```
    Script downloads the version specified in the Bash script
    (at the moment 1.9.2) and installs it to `~/.go` directory.


    ## Check that it was added to your shell config

    ```sh
    cat ~/.bashrc
    ```

    ## Reload your shell

    ```sh
    source ~/.bashrc
    ```

    ## Try if it works

    ```sh
    go help
    ```

    That should show a quick help for the `go` command.
  5. d2s revised this gist Jun 9, 2017. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -24,14 +24,14 @@ Now after installing the old version, look for the latest release.
    - Then look if that release is available via gvm:
    - `gvm listall`
    - Install latest version
    - `gvm install go1.8.1`
    - `gvm install go1.8.3`
    - Set it as the default version:
    - `gvm use go1.8.1 --default`
    - `gvm use go1.8.3 --default`


    ## Updating to a new version

    If you have previous version of Go already installed, you can update to a new release version of Go with these steps:

    - `gvm install go1.8.1`
    - `gvm use go1.8.1 --default`
    - `gvm install go1.8.3`
    - `gvm use go1.8.3 --default`
  6. d2s revised this gist Apr 10, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -24,9 +24,9 @@ Now after installing the old version, look for the latest release.
    - Then look if that release is available via gvm:
    - `gvm listall`
    - Install latest version
    - `gvm install go1.6.3`
    - `gvm install go1.8.1`
    - Set it as the default version:
    - `gvm use go1.6.3 --default`
    - `gvm use go1.8.1 --default`


    ## Updating to a new version
  7. d2s revised this gist Apr 10, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -33,5 +33,5 @@ Now after installing the old version, look for the latest release.

    If you have previous version of Go already installed, you can update to a new release version of Go with these steps:

    - `gvm install go1.7`
    - `gvm use go1.7 --default`
    - `gvm install go1.8.1`
    - `gvm use go1.8.1 --default`
  8. d2s revised this gist Aug 27, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ Now after installing the old version, look for the latest release.
    - `gvm use go1.6.3 --default`


    ## Updating to the a version
    ## Updating to a new version

    If you have previous version of Go already installed, you can update to a new release version of Go with these steps:

  9. d2s revised this gist Aug 27, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ Now after installing the old version, look for the latest release.
    - `gvm use go1.6.3 --default`


    ## Updating to the new version
    ## Updating to the a version

    If you have previous version of Go already installed, you can update to a new release version of Go with these steps:

  10. d2s revised this gist Aug 27, 2016. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -28,3 +28,10 @@ Now after installing the old version, look for the latest release.
    - Set it as the default version:
    - `gvm use go1.6.3 --default`


    ## Updating to the new version

    If you have previous version of Go already installed, you can update to a new release version of Go with these steps:

    - `gvm install go1.7`
    - `gvm use go1.7 --default`
  11. d2s created this gist Jul 18, 2016.
    30 changes: 30 additions & 0 deletions installing-go-to-ubuntu-linux.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Installing Go to Ubuntu Linux

    ## Install [gvm](https://github.com/moovweb/gvm)

    ### Install required packages for gvm

    ```
    sudo apt-get install curl git mercurial make binutils bison gcc build-essential
    ```

    ### Install old Go version first

    ```
    gvm install go1.4 -B
    gvm use go1.4
    export GOROOT_BOOTSTRAP=$GOROOT
    ```

    ### Look what is the latest Go version

    Now after installing the old version, look for the latest release.

    - Open URL https://golang.org/dl/ and look what is the latest version number.
    - Then look if that release is available via gvm:
    - `gvm listall`
    - Install latest version
    - `gvm install go1.6.3`
    - Set it as the default version:
    - `gvm use go1.6.3 --default`