Installation of go1.17.linux-amd64.tar.gz onto Ubuntu Linux Desktop 20.04.3 LTS failed

1,770 views
Skip to first unread message

Fajar Sumirat

unread,
Aug 29, 2021, 1:06:00 AM8/29/21
to golang-nuts
Condition:

[a] My laptop specification 

     $ cat /etc/os-release

fajar@fajar-Lenovo-ideapad-320-14AST:~$ cat /etc/os-release
       NAME="Ubuntu"
       VERSION="20.04.3 LTS (Focal Fossa)"
       ID=ubuntu
       ID_LIKE=debian
       PRETTY_NAME="Ubuntu 20.04.3 LTS"
       VERSION_ID="20.04"
       HOME_URL="https://www.ubuntu.com/"
      SUPPORT_URL="https://help.ubuntu.com/"
      BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
      PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-                    policies/privacy-policy"
     VERSION_CODENAME=focal
     UBUNTU_CODENAME=focal

  $ hostnamectl

fajar@fajar-Lenovo-ideapad-320-14AST:~$ hostnamectl
     Static hostname: fajar-Lenovo-ideapad-320-14AST
     Icon name: computer-laptop
     Chassis: laptop
     Machine ID: 77c0f862f304457d97bfb2a0283ad731
     Boot ID: e9cb19a5ef5d4d7a82977247884e8782
     Operating System: Ubuntu 20.04.3 LTS
     Kernel: Linux 5.11.0-27-generic
     Architecture: x86-64

[b] My current working directory

      fajar@fajar-Lenovo-ideapad-320-14AST:~$ pwd
      /home/fajar

[c] i am trying to install Go Installer :  go1.17.linux-amd64.tar.gz


[d] Then i typed in Terminal :

     sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz

     the ouput then:

     fajar@fajar-Lenovo-ideapad-320-14AST:~$ sudo tar -C /usr/local -xzf  go1.17.linux-amd64.tar.gz
[sudo] password for fajar:
fajar@fajar-Lenovo-ideapad-320-14AST:~$ 

[e] Then i typed this command:

     $ echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc

     output:

     fajar@fajar-Lenovo-ideapad-320-14AST:~$ $ echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
$: command not found

[f] i then typed :

    go version

    Then, the ouput

    fajar@fajar-Lenovo-ideapad-320-14AST:~$ go version
go version go1.16.6 linux/amd64


[g] Then, i typed command :

      tar: go: Cannot mkdir: Permission denied
tar: go/src/net/http/httputil: Cannot mkdir: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/src/net/http/httputil/dump.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/src/net/http/httputil/dump_test.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/src/net/http/httputil/example_test.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/src/net/http/httputil/httputil.go: Cannot open: No such file or directory
.
.
.
tar: go: Cannot mkdir: Permission denied
tar: go/test/winbatch.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/test/writebarrier.go: Cannot open: No such file or directory
tar: go: Cannot mkdir: Permission denied
tar: go/test/zerodivide.go: Cannot open: No such file or directory
tar: Exiting with failure status due to previous errors

[h] Then i typed again:

     go version

      fajar@fajar-Lenovo-ideapad-320-14AST:~$ go version
      go version go1.16.6 linux/amd64


QUESTION:

why the active Go is not what i expected ? => go1.17

Thankyou

Brian Candler

unread,
Aug 29, 2021, 4:52:36 AM8/29/21
to golang-nuts
On Sunday, 29 August 2021 at 06:06:00 UTC+1 fajars...@cloudgdrive.com wrote:
QUESTION:

why the active Go is not what i expected ? => go1.17


Type "which go".  It will show you where the "go" binary is that's being picked up.  It appears you have go 1.16 installed elsewhere, and is being picked up from somewhere in your $PATH

> [g] Then, i typed command :
>      tar: go: Cannot mkdir: Permission denied
> tar: go/src/net/http/httputil: Cannot mkdir: No such file or directory
> tar: go: Cannot mkdir: Permission denied

You didn't show the actual command that you typed.  However it looks like you're trying to untar go into some directory that you don't have permissions to write into, e.g. /usr/local - and hence step [g] has failed completely.

Sean Liao

unread,
Aug 29, 2021, 8:12:23 AM8/29/21
to golang-nuts
[e] you shouldn't be including `$` in your command

try `/usr/local/go/bin/go version`, if that's 1.17 then you only need to fix your $PATH

Reply all
Reply to author
Forward
0 new messages