Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall Go?

Tags:

go

I tried the answer here Removed golang but go command still works?, but it didn't work (I can still run go)

Currently, when I run which go I see this output

/usr/local/go/bin/go 

I think I had two installations of go as my GOPATH was pointing to another folder named gocode. I've now removed that folder, and the usr/local/go/bin/go folder.

I've also removed my GOPATH. However, I can still run go.

How do I uninstall go?

like image 663
praks5432 Avatar asked Feb 12 '17 09:02

praks5432


2 Answers

Update August 2019

Found the official uninstall docs worked as expected (on Mac OSX).

$ which go /usr/local/go/bin/go 

In summary, to uninstall:

$ sudo rm -rf /usr/local/go $ sudo rm /etc/paths.d/go 

Then, did a fresh install with homebrew using brew install go. Now, i have:

 $ which go /usr/local/bin/go 
like image 64
arcseldon Avatar answered Sep 20 '22 06:09

arcseldon


You might try

rm -rvf /usr/local/go/ 

then remove any mention of go in e.g. your ~/.bashrc; then you need at least to logout and login.

However, be careful when doing that. You might break your system badly if something is wrong.

PS. I am assuming a Linux or POSIX system.

like image 40
Basile Starynkevitch Avatar answered Sep 19 '22 06:09

Basile Starynkevitch