bash: /home/linuxbrew/.linuxbrew/bin/go: 错误的地址

huangapple go评论91阅读模式
英文:

bash: /home/linuxbrew/.linuxbrew/bin/go: Bad address

问题

我进行了一次brew upgrade之后,一直出现一个错误提示"bad address"。尝试过卸载/重新安装所有内容,但无法找出问题所在。

bash: /home/linuxbrew/.linuxbrew/bin/go: Bad address

我对终端和Linux不太熟悉,所以欢迎任何建议。

我尝试了brew doctor命令。它显示"未安装开发者工具",然后我执行了'brew install gcc'命令,它显示gcc已经安装并且是最新版本。

英文:

I did an brew upgrade and afterwards keep getting an bad address error.
Tried to uninstall/reinstall everything, but cant figure out what is the problem.

bash: /home/linuxbrew/.linuxbrew/bin/go: Bad address

Im new to terminal and linux, so all advice is welcome.

I tried brew doctor. It says "No developer tools installed." and after i 'brew install gcc' it says gcc is already installed and up-to-date.

答案1

得分: 1

请使用官方的Go安装方式:

Go:下载和安装

为了获得完整的支持,请避免使用操作系统的软件包管理器、Homebrew等其他方法。


首先,移除之前使用其他方法安装的Go,例如Homebrew。

英文:

Use the official Go installation:

Go: Download and install

For full support, avoid OS package managers, Homebrew, and so forth.


First, remove any previous installations by other methods, for example, Homebrew.

答案2

得分: 1

这篇帖子是关于我在使用Go和Brew时遇到类似问题时的建议,虽然有点晚了。

当Brew更新提供的Go版本(在我的情况下是从1.19.3更新到1.19.5)时,由于某种原因它没有正确更新GOROOT环境变量。将该变量的值更正后,问题就解决了。

export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/<go_version>/libexec

# 例如
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.19.5/libexec
英文:

Little late, but this post was a suggestion for me when I ran into a similar issue with Go and Brew.

When Brew updates the version of Go (1.19.3 -> 1.19.5 in my case) that it is providing, for some reason it does not correctly update the GOROOT environment varaible. Correcting the value of the variable fixed the issue for me.

export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/&lt;go_version&gt;/libexec

# example
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.19.5/libexec

huangapple
  • 本文由 发表于 2022年11月29日 20:26:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/74614075.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定