Home  >  Article  >  Backend Development  >  Go: /usr/local/go/bin does not exist on CentOS 7.9

Go: /usr/local/go/bin does not exist on CentOS 7.9

王林
王林forward
2024-02-13 19:36:08943browse

Go:CentOS 7.9 上不存在 /usr/local/go/bin

php editor Xigua discovered a problem on CentOS 7.9, that is, the /usr/local/go/bin path does not exist on this operating system. This problem may cause some Go language-related operations to fail to work properly. Before solving this problem, we need to first understand CentOS 7.9 and Go language related knowledge. Next, we will introduce in detail how to solve this problem to ensure the normal use of the Go language.

Question content

I am on a CentOS 7.9 virtual machine and trying to install Go by following this process (rif. https://computingforgeeks.com/install-go-golang-on-centos- rhel-linux/)

sudo yum -y install wget

wget https://go.dev/dl/go1.19.3.src.tar.gz

sha256sum go1.19.3.src.tar.gz

sudo tar -C /usr/local -xzf go*.src.tar.gz

Then I added

export PATH=$PATH:/usr/local/go/bin

exist

  • $HOME/.profile
  • /etc/profile

at last

source $HOME/.profile

source /etc/profile

But when I try the command

go version

turn out

-bash: go: command not found

As shown in the picture, I see that there is no bin directory under the path /usr/local/go

Any suggestions would be greatly appreciated and thanks in advance

Workaround

It looks like you are downloading source code, not binaries. You should do this

wget https://go.dev/dl/go1.19.3.linux-amd64.tar.gz

no

wget https://go.dev/dl/go1.19.3.src.tar.gz

The above is the detailed content of Go: /usr/local/go/bin does not exist on CentOS 7.9. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete