{"id":13495285,"url":"https://github.com/udhos/update-golang","last_synced_at":"2025-05-14T09:10:02.278Z","repository":{"id":40625840,"uuid":"87860806","full_name":"udhos/update-golang","owner":"udhos","description":"update-golang is a script to easily fetch and install new Golang releases with minimum system intrusion","archived":false,"fork":false,"pushed_at":"2025-04-04T18:05:53.000Z","size":146,"stargazers_count":1881,"open_issues_count":2,"forks_count":231,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-14T09:09:45.908Z","etag":null,"topics":["go","golang","script","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/udhos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-10T21:50:01.000Z","updated_at":"2025-05-13T11:35:27.000Z","dependencies_parsed_at":"2023-11-12T04:24:19.205Z","dependency_job_id":"43898232-880a-4da2-aab7-3829a9d262a8","html_url":"https://github.com/udhos/update-golang","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fupdate-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fupdate-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fupdate-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fupdate-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udhos","download_url":"https://codeload.github.com/udhos/update-golang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","script","shell"],"created_at":"2024-07-31T19:01:33.191Z","updated_at":"2025-05-14T09:09:57.263Z","avatar_url":"https://github.com/udhos.png","language":"Shell","funding_links":[],"categories":["Shell","shell","Languages and frameworks","Repositories"],"sub_categories":["Golang"],"readme":"[![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/udhos/update-golang/blob/master/LICENSE)\n[![Travis Build Status](https://travis-ci.org/udhos/update-golang.svg?branch=master)](https://travis-ci.org/udhos/update-golang)\n\n# update-golang\nupdate-golang is a script to easily fetch and install new Golang releases with minimum system intrusion.\n\nTable of Contents\n=================\n\n  * [How it works](#how-it-works)\n  * [Usage](#usage)\n  * [Caution](#caution)\n  * [Remove](#remove)\n  * [Example](#example)\n  * [Customization](#customization)\n  * [Per\\-user Install](#per-user-install)\n\nCreated by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc.go)\n\nHow it works\n============\n\nThe script is based on official installation instructions from https://go.dev/doc/install.\n\nThis is the default behavior:\n\n1\\. Search for the latest binary release in https://go.dev/dl/.\n\n2\\. The script uses local system OS and ARCH to download the correct binary release. It is not harmful to run the script multiple times. Downloaded releases are kept as cache under '/usr/local'. You can erase them manually.\n\nBy default, the script only detects actual releases (not beta releases, not release candidates). However one can force any specific non-final release:\n\n    $ # force specific release candidate\n    $ sudo RELEASE=1.11rc1 ./update-golang.sh\n\n3\\. The release is installed at '/usr/local/go'.\n\n4\\. The path '/usr/local/go/bin' is added to PATH using '/etc/profile.d/golang_path.sh'.\n\n5\\. Only if needed, GOROOT is properly setup, also using '/etc/profile.d/golang_path.sh'.\n\nThe script DOES NOT ever modify the GOPATH variable.\n\nYou can customize the behavior by setting environment variables (see Customization below).\n\nUsage\n=====\n\n    git clone https://github.com/udhos/update-golang\n    cd update-golang\n    sudo ./update-golang.sh\n\nCaution\n=======\n\nBefore running the script, make sure you have an untampered copy by verifying the SHA256 checksum.\n\n    $ wget -qO hash.txt https://raw.githubusercontent.com/udhos/update-golang/master/update-golang.sh.sha256\n    $ sha256sum -c hash.txt\n    update-golang.sh: OK\n\nRemove\n======\n\nYou can use the 'remove' option to undo update-golang.sh work:\n\n    $ sudo ./update-golang.sh remove\n\nDeclutter\n======\n\nYou can use the '-declutter' option to prevent caching downloaded archives:\n\n    $ sudo ./update-golang.sh -declutter\n\nExample\n=======\n\nSample session:\n\n    lab@ubu1:~$ go\n    The program 'go' can be found in the following packages:\n     * golang-go\n     * gccgo-go\n    Try: sudo apt install \u003cselected package\u003e\n    lab@ubu1:~$\n    lab@ubu1:~$ git clone https://github.com/udhos/update-golang\n    Cloning into 'update-golang'...\n    remote: Counting objects: 481, done.\n    remote: Compressing objects: 100% (11/11), done.\n    remote: Total 481 (delta 4), reused 9 (delta 2), pack-reused 468\n    Receiving objects: 100% (481/481), 70.22 KiB | 125.00 KiB/s, done.\n    Resolving deltas: 100% (248/248), done.\n    lab@ubu1:~$\n    lab@ubu1:~$ cd update-golang\n    lab@ubu1:~/update-golang$ sudo ./update-golang.sh\n    update-golang.sh: version 0.15\n    update-golang.sh: find_latest: found last release: 1.10.2\n    update-golang.sh: user: uid=0(root) gid=0(root) groups=0(root)\n    update-golang.sh: RELEASE_LIST=https://golang.org/doc/devel/release.html\n    update-golang.sh: SOURCE=https://storage.googleapis.com/golang\n    update-golang.sh: DESTINATION=/usr/local\n    update-golang.sh: RELEASE=1.10.2\n    update-golang.sh: OS=linux\n    update-golang.sh: ARCH_PROBE=uname -m\n    update-golang.sh: ARCH=amd64\n    update-golang.sh: PROFILED=/etc/profile.d/golang_path.sh\n    update-golang.sh: CACHE=/usr/local\n    update-golang.sh: GOPATH=\n    update-golang.sh: DEBUG=\n    update-golang.sh: will install golang go1.10.2.linux-amd64 as: /usr/local/go\n    update-golang.sh: https://storage.googleapis.com/golang/go1.10.2.linux-amd64.tar.gz is remote\n    update-golang.sh: no need to download - file cached: /usr/local/go1.10.2.linux-amd64.tar.gz\n    update-golang.sh: remove_old_link: not found symlink for old install\n    update-golang.sh: untar: tar -x -f /usr/local/go1.10.2.linux-amd64.tar.gz\n    update-golang.sh: path: removing old settings from: /etc/profile.d/golang_path.sh\n    update-golang.sh: path: issuing new /usr/local/go/bin to /etc/profile.d/golang_path.sh\n    update-golang.sh: path: issuing /home/lab/go/bin to /etc/profile.d/golang_path.sh\n    update-golang.sh: golang go1.10.2.linux-amd64 installed at: /usr/local/go\n    update-golang.sh: testing: /usr/local/go/bin/go version\n    update-golang.sh: go version go1.10.2 linux/amd64\n    update-golang.sh: /usr/local/go/bin/go version: SUCCESS\n    update-golang.sh: testing: /usr/local/go/bin/go run /tmp/hello-tmpv1bX1rQN.go\n    update-golang.sh: hello, world\n    update-golang.sh: /usr/local/go/bin/go run /tmp/hello-tmpv1bX1rQN.go: SUCCESS\n    update-golang.sh: cleanup: /tmp/tmp.tcNY25eXNl\n    lab@ubu1:~/update-golang$\n\nCustomization\n=============\n\nThese environment variables are available for customization:\n\n    RELEASE_LIST=https://golang.org/doc/devel/release.html ;# search for new releases from this url\n    SOURCE=https://storage.googleapis.com/golang           ;# download source location\n    DESTINATION=/usr/local                                 ;# install destination\n    RELEASE=1.8.3                                          ;# force golang release\n    OS=linux                                               ;# force os\n    ARCH_PROBE='uname -m'                                  ;# force arch detection command\n    ARCH=amd64                                             ;# force arch\n    PROFILED=/etc/profile.d/golang_path.sh                 ;# update PATH, optionally set GOROOT\n    CACHE=/usr/local                                       ;# cache downloads in this dir\n    GOPATH=                                                ;# use this GOPATH\n    DEBUG=                                                 ;# set to enable debug\n\nExample:\n\n    $ sudo RELEASE=1.9beta1 ./update-golang.sh\n\nPer-user Install\n================\n\nDefault behavior is to install Golang globally for all system users.\n\nHowever you can use the environment variables to point locations to your per-user home directory.\n\nThe per-user installation does not need root (sudo) privileges.\n\nExample installing:\n\n    This example will install Golang under ~/golang for current user only.\n    \n    $ mkdir ~/golang\n    $ DESTINATION=~/golang PROFILED=~/.bash_profile ./update-golang.sh\n\nExample uninstalling:\n\n    To uninstall, make sure to provide the same env vars used for installing:\n\n    $ DESTINATION=~/golang PROFILED=~/.bash_profile ./update-golang.sh remove\n\nEND\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudhos%2Fupdate-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudhos%2Fupdate-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudhos%2Fupdate-golang/lists"}