Installation of Go on Ubuntu

Hey folks! I am getting an error related to Go, can anybody help me out? I have got Golang installed on my ubuntu, I followed all the steps as mentioned in the official docs, even the Go folder is present in the usr/local/ directory but when I try to run go version it says go command not found

Screenshot from 2022-11-03 22-13-01

@Rakshit.Gondwal You need to add the change to PATH in your .profile . You can do this by adding this line to your /etc/profile.

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

For more info check the point 2 from the official docs docs_go

I did this, but it is showing the same error.

did you add this in this ~/.profile file ?

Maybe, here’s how the .profile file looks, can you check?

Still getting the same error, even after reinstalling ubuntu on my system.

What output do you get from a sudo snap install go?

I was able to figure this out with the help of Install Golang in Linux | Ubuntu using terminal | Ubuntu 20.04LTS - YouTube.

1 Like