0

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.

Prkpll
  • 11
  • 2
  • Please consider not using this contraption on Linux. Please do `apt install golang-go` and be done with it. Once you're comfortable with Go, you'll be able to use already installed Go to build yourself a newer version of Go, if badly needed. – kostix Nov 29 '22 at 12:56
  • 1
    If, for some reason, you're not comfortable with the version of Go packaged in your OS, consider [downloading an official `.tar.gz` package](https://go.dev/dl/) and unwrapping it. Still, if you're about just starting with the language, I'd recommend to start small and install what's packaged in your OS. Bleeding-edge versions of the language are usually required by those who uses the language on their $dayjob, and, once, in such situation, you usually build Go from the sourc ecode, not mess with non-Linux solutions. – kostix Nov 29 '22 at 12:59

2 Answers2

1

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.

rocka2q
  • 2,473
  • 4
  • 11
1

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