goprotocol-buffersgrpcproto

having difficulty installing protocol buffer on ubuntu


I need a specific version of protocol buffer which is 3.14.0 on apt its not available like this

sudo apt install -y protobuf-compiler = 3.14.0

and If I follow these steps by binary :

$ PB_REL="https://github.com/protocolbuffers/protobuf/releases"
$ curl -LO $PB_REL/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip

then

unzip protoc-3.14.0-linux-x86_64.zip -d $HOME/.local

then

$ export PATH="$PATH:$HOME/.local/bin"

from this source

and it's not getting install when I do protoc --version I am getting this error

bash: /usr/bin/protoc: No such file or directory

Solution

  • I think Because /usr/bin/protoc doesn't exist. When you unzipped you got folder named protoc-3.14.0. which is /usr/bin/protoc-3.14.0

    try doing this

    PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
    curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/$PROTOC_ZIP
    sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
    

    ref: http://google.github.io/proto-lens/installing-protoc.html