Difference between revisions of "Go install"
Jump to navigation
Jump to search
(Created page with "``` sudo snap install --classic go ```") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | |||
+ | https://golang.org/doc/install | ||
+ | ``` | ||
+ | #!/bin/bash | ||
+ | set -eu | ||
+ | version=1.22.1 | ||
+ | sudo apt remove -y golang-go || true | ||
+ | # curl -LO https://go.dev/dl/go1.20.3.linux-amd64.tar.gz | ||
+ | curl -LO https://golang.org/dl/go$version.linux-amd64.tar.gz | ||
+ | sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$version.linux-amd64.tar.gz | ||
+ | echo 'export PATH=${PATH}:/usr/local/go/bin' >> ~/.bashrc | ||
+ | . ~/.bashrc | ||
+ | ``` | ||
+ | |||
+ | Snap | ||
``` | ``` | ||
sudo snap install --classic go | sudo snap install --classic go | ||
+ | ``` | ||
+ | |||
+ | Apt | ||
+ | ``` | ||
+ | sudo apt install -y golang-go | ||
``` | ``` |
Latest revision as of 14:49, 23 March 2024
https://golang.org/doc/install
#!/bin/bash set -eu version=1.22.1 sudo apt remove -y golang-go || true # curl -LO https://go.dev/dl/go1.20.3.linux-amd64.tar.gz curl -LO https://golang.org/dl/go$version.linux-amd64.tar.gz sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$version.linux-amd64.tar.gz echo 'export PATH=${PATH}:/usr/local/go/bin' >> ~/.bashrc . ~/.bashrc
Snap
sudo snap install --classic go
Apt
sudo apt install -y golang-go