protoc-gen-go command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
protoc-gen-go: command not found
or when using sudo you get the following error message
sudo: protoc-gen-go: command not found
Solutions to protoc-gen-go: command not found
How To Fix protoc-gen-go: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu protoc-gen-go is provided by golang-goprotobuf-dev package.
golang-goprotobuf-dev is:
Adds support for serializing and deserializing data in the protocol buffer format for users of the Go language. This will also install a protobuf compiler filter which will allow you to compile protocol buffers to Go code using protoc from the protobuf-compiler package.
To fix this problem, we can install more using the command below.
sudo apt-get -y install golang-goprotobuf-dev
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install golang-goprotobuf-dev.
sudo apt -y install golang-goprotobuf-dev
Or if you have aptitude installed you can use the following command.
sudo aptitude install golang-goprotobuf-dev
Summary
In this tutorial we learn how to fix protoc-gen-go command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.