If you are a non-C++ user and/or don't want to compile it yourself, the simplest way to install the current version of protoc is to download a pre-built binary from the release page.
To install, simply place this binary somewhere in your PATH (e.g. /usr/local/bin).
(If you intend to use the included well known types then don't forget to
copy the contents of the 'include' directory somewhere as well, for example
into /usr/local/include/.)
See https://github.com/protocolbuffers/protobuf/blob/master/src/README.md:
Prerequesites
Installation
protobuf-all-[VERSION].tar.gz
../configure
make
make check
sudo make install
sudo ldconfig # refresh shared library cache.
Check if it works
If you are a non-C++ user and/or don't want to compile it yourself, the simplest way to install the current version of protoc is to download a pre-built binary from the release page.
https://github.com/protocolbuffers/protobuf/releases
To install, simply place this binary somewhere in your PATH (e.g. /usr/local/bin).
(If you intend to use the included well known types then don't forget to copy the contents of the 'include' directory somewhere as well, for example into /usr/local/include/.)
You can download binary from the source code and use next commands
Change your base to /usr/, or /usr/loca/, or anything else in your PATH.
1) Download binary from the url https://github.com/protocolbuffers/protobuf/releases
2) extract and keep the directory at particular location (/user/app/protoc)
3) add the entry in /usr//.bash_profile as
export PROTOC_HOME=/user/app/protoc export PATH=$PROTOC_HOME/bin:$PATH
4) refresh file
$source /usr/<username>/.bash_profile
Other option is run the following command one by one after downloading the repository :
sudo rm -rf ./protoc
unzip protoc-3.10.1-linux-x86_64.zip -d protoc
chmod 755 -R protoc
BASE=/usr/local
sudo rm -rf $BASE/include/google/protobuf/
sudo cp protoc/bin/protoc $BASE/bin
sudo cp -R protoc/include/* $BASE/include
Use this if you are having errors like
This is useful when you are doing generation for go using protoc-gen-go as it requires the base proto files to be present in default include folders