Last active
December 3, 2018 21:33
-
-
Save nileshsimaria/8eab612aa81d873a76ece1a8e6d97cc7 to your computer and use it in GitHub Desktop.
protoc3 on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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