In order to install Golang (Go Language) on Ubuntu, follow the below steps:
- Open Linux Terminal by pressing Ctrl+Alt+T or searching for "Terminal" in the applications menu.
- Update the package list by typing sudo apt-get update. This ensures you have the latest information about available packages.
- To install Golang, use the following command:
. This will download and install the latest version of Go available in the Ubuntu repositories.sudo apt-get install golang-go - After installation, verify that Go was installed correctly by checking the version:
You should see output similar to:go version
(Note: The exact version number may differ depending on the latest available version)go version go1.18.1 linux/amd64 - Set up your Go workspace by creating a directory for your Go projects:
mkdir ~/go - Add the following lines to your ~/.bashrc file to set up your Go environment variables:
export GOPATH=$HOME/go export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin - Apply the changes by running:
source ~/.bashrc - Congratulations! You have successfully installed Go and set up your Go workspace. You're now ready to start coding in Go!

If you encounter any issues during the installation process, please don't hesitate to leave a comment. I'm here to help!
Frequently Asked Questions (FAQs)
What is Golang?
Why should I use Golang?
Can I install Go on other Linux distributions?
How do I update Golang to the latest version?
What is GOPATH?
Do I need to set GOPATH manually?
Can I install multiple versions of Go?
How do I uninstall Go from Ubuntu?
What IDEs or text editors are recommended for Go development?
Where can I find resources to learn Go programming?
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!