Skip to content

Instantly share code, notes, and snippets.

@boddumanohar
Last active February 20, 2021 15:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boddumanohar/0b1a2cb277c3b73d07d5232eba986bb6 to your computer and use it in GitHub Desktop.
Save boddumanohar/0b1a2cb277c3b73d07d5232eba986bb6 to your computer and use it in GitHub Desktop.
How to Install Latest Protobuf on Ubuntu 20

METHOD 1:

PROTOCOL_BUF_VERSION=v3.15.1
PROTOC_GEN_GO_GRPC_VERSION=v1.1.0
PROTOC_GEN_GO_VERSION=v1.25.0
wget https://github.com/protocolbuffers/protobuf/releases/download/$PROTOCOL_BUF_VERSION/protoc-$PROTOCOL_BUF_VERSION-linux-x86_64.zip
wget https://github.com/grpc/grpc-go/releases/download/cmd/protoc-gen-go-grpc/$PROTOGEN_GO_GRPC_VERSION/protoc-gen-go-grpc.$PROTOGEN_GO_GRPC_VERSION.linux.amd64.tar.gz
wget wget https://github.com/protocolbuffers/protobuf-go/releases/download/$PROTOC_GEN_GO_VERSION/protoc-gen-go.$PROTOC_GEN_GO_VERSION.linux.amd64.tar.gz
sudo unzip -o protoc-3.15.1-linux-x86_64.zip -d /usr/local bin/protoc
sudo unzip -o protoc-3.15.1-linux-x86_64.zip -d /usr/local 'include/*'
sudo tar -C /usr/local/bin -xvf protoc-gen-go-grpc.$PROTOGEN_GO_GRPC_VERSION.linux.amd64.tar.gz
sudo tar -C /usr/local/bin -xvf protoc-gen-go.$PROTOC_GEN_GO_VERSION.linux.amd64.tar.gz
sudo chmod +x /usr/local/bin/protoc-gen-go
sudo chmod +x /usr/local/bin/protoc-gen-go-grpc

METHOD 2:

sudo apt-get update protobuf-compiler
go get google.golang.org/protobuf/cmd/protoc-gen-go \
         google.golang.org/grpc/cmd/protoc-gen-go-grpc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment