udhos / update-golang

update-golang is a script to easily fetch and install new Golang releases with minimum system intrusion
MIT License
1.86k stars 227 forks source link

Problem at installing go #42

Closed T3jv1l closed 8 months ago

T3jv1l commented 8 months ago

Ubuntu 22.04

update-golang.sh: find_latest: FAILED
update-golang.sh: user: uid=0(root) gid=0(root) groups=0(root)
update-golang.sh: 
update-golang.sh: RELEASE_LIST=https://go.dev/dl/
update-golang.sh: SOURCE=https://storage.googleapis.com/golang
update-golang.sh: DESTINATION=/usr/local
update-golang.sh: RELEASE=1.21.4
update-golang.sh: OS=linux
update-golang.sh: ARCH_PROBE=uname -m
update-golang.sh: ARCH=amd64
update-golang.sh: PROFILED=/etc/profile.d/golang_path.sh
update-golang.sh: CACHE=/usr/local
update-golang.sh: GOPATH=
update-golang.sh: DEBUG=
update-golang.sh: FORCE_IPV4=           ;# set FORCE_IPV4=-4 to force IPv4
update-golang.sh: CONNECT_TIMEOUT=5
update-golang.sh: SKIP_WGET=             ;# set SKIP_WGET=1 to skip wget
update-golang.sh: 
update-golang.sh: will install golang go1.21.4.linux-amd64 as: /usr/local/go
update-golang.sh: https://storage.googleapis.com/golang/go1.21.4.linux-amd64.tar.gz is remote
update-golang.sh: no need to download - file cached: /usr/local/go1.21.4.linux-amd64.tar.gz
update-golang.sh: remove_old_link: not found symlink for old install
update-golang.sh: untar: tar -x -f /usr/local/go1.21.4.linux-amd64.tar.gz
tar: This does not look like a tar archive

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
update-golang.sh: die: untar: failed: /usr/local/go1.21.4.linux-amd64.tar.gz
udhos commented 8 months ago

AFAICT, the script failed to download files from Internet.

I can think of two causes for problem:

1 - Internet was offline when the script was invoked.

2 - Some corporate proxy is denying Internet access for the script. You might need to set env vars HTTP_PROXY, HTTPS_PROXY pointing to your proxy before running the script.

I have just tested the script on my system and it worked. It is Ubuntu 22.04 as well:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy
T3jv1l commented 8 months ago

This issue is when i run the script in ansible. Also i dont have installed the go on system

udhos commented 8 months ago

I havent tested it with Ansible, hence I cant tell whether it should work that way.

Have you checked if it works on the target system when invoked interactively without Ansible?

T3jv1l commented 8 months ago

it work without ansible.