Skip to content

Instantly share code, notes, and snippets.

@nileshsimaria
Last active December 3, 2018 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nileshsimaria/8eab612aa81d873a76ece1a8e6d97cc7 to your computer and use it in GitHub Desktop.
Save nileshsimaria/8eab612aa81d873a76ece1a8e6d97cc7 to your computer and use it in GitHub Desktop.
protoc3 on Ubuntu
I am on Ubuntu 16.04.5 LTS.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
I wanted to install latest protoc (which at the time of writing this is version 3.6.1).
Running apt-get (as whoen below) installed version 2.6.1
$ sudo apt-get install protobuf-compiler
$ sudo apt-get install libprotobuf-dev
$ protoc --version
libprotoc 2.6.1
Getting latest protoc on Ubuntu is easy. Following are the instructions.
1. Find the latest release or the release you want at https://github.com/protocolbuffers/protobuf/releases
2. Locate your release and download it. I am getting 3.6.1
$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
3. Unzip it
$ unzip protoc-3.6.1-linux-x86_64.zip -d protoc-3.6.1
4. $ cd protoc-3.6.1/bin
5. $ ./protoc --version
libprotoc 3.6.1
6. move protoc the binary to appropriate bin directory.
Generate descriptor files.
$ protoc --descriptor_set_out=./descriptors.protoset \
--include_source_info \
--include_imports -I. po.proto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment