英文:
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安装方式:
为了获得完整的支持,请避免使用操作系统的软件包管理器、Homebrew等其他方法。
首先,移除之前使用其他方法安装的Go,例如Homebrew。
英文:
Use the official Go installation:
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/<go_version>/libexec
# example
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.19.5/libexec
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论