LocalHake

Tutorial

Install Go and grpcurl on Ubuntu

A quick guide to installing Go and grpcurl on Ubuntu, covering downloading the latest Go release, configuring environment variables, and installing grpcurl via go install.

Hake HardwarePublished Updated ~3 minbeginner

This post contains paid links (affiliate) — how that works.


▶ Watch this build on YouTube
Contents

With your Ubuntu terminal up, let's get started!

The first thing is to grab the latest version from the Go download page here. You can 'right click' and copy the link. Then execute this command:

text
wget <download link>

Make sure to paste in your download link where the brackets are. Next, extract the files:

text
tar -xf go1.21.3.linux-amd64.tar.gz

This will create a folder named 'go'. This next step is not always needed, but it's good practice. It will remove any previous version installed:

text
sudo rm -rf /usr/local/go

Since we are going to be moving the 'go' folder we just extracted to a root owned folder '/usr/local', we need to change its ownership to root.

text
sudo chown -R root:root ./go

Now we can move it to its new home

text
sudo mv -v go /usr/local

Go is now installed, but in order to run commands we need to update our profile, let's open it up with nano and add some new lines

text
sudo nano /etc/profile

Then add the following at the bottom

text
# Go Lang Path
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

Now you can either exit out of your terminal and open it back up, or you can reload your profile with

text
source /etc/profile

That's it! Go is installed. To verify you can check the version by running this

text
go version

I also want to install grpcurl, so to do that I just need one command:

text
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest

This will take sometime as it downloads and installs. To make sure everything is working you can run the 'help' command, you should see the help text printed

text
grpcurl -help

And that's it! Congratulations, you now have Go and grpcurl installed!

Gear used