Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install protobuf 3.6.1 on Ubuntu 16.04
#! /bin/bash
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
# Unzip
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
sudo mv protoc3/include/* /usr/local/include/
# Optional: change owner
sudo chown $USER /usr/local/bin/protoc
sudo chown -R $USER /usr/local/include/google
@martinthurn

This comment has been minimized.

Copy link

@martinthurn martinthurn commented Nov 7, 2018

Thank you for this!
Rather than mv, I prefer cp -pr
Also, one should also do sudo ldconfig at the end, to add the new libraries to the LD path

@thavoo

This comment has been minimized.

Copy link

@thavoo thavoo commented Jun 18, 2019

thanks for this.

@jhonnynetworker

This comment has been minimized.

Copy link

@jhonnynetworker jhonnynetworker commented Jun 19, 2019

Thanks! right

@alsundma

This comment has been minimized.

Copy link

@alsundma alsundma commented Jun 21, 2019

Thank! very helpful.

@KrishnaGolakoti

This comment has been minimized.

Copy link

@KrishnaGolakoti KrishnaGolakoti commented Jul 24, 2019

I have followed the above steps to upgrade from older version of protoc to 3+. still I get protoc --version as "libprotoc 2.6.1".

@suraj2596

This comment has been minimized.

Copy link

@suraj2596 suraj2596 commented Nov 29, 2019

Just consolidated the whole process by considering other comments

#! /bin/bash
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip

# Unzip
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3

# Move protoc to /usr/local/bin/
sudo cp -r protoc3/bin/* /usr/local/bin/

# Move protoc3/include to /usr/local/include/
sudo cp -r protoc3/include/* /usr/local/include/

# Optional: change owner
sudo chown $USER /usr/local/bin/protoc
sudo chown -R $USER /usr/local/include/google

sudo ldconfig
@etatbak

This comment has been minimized.

Copy link

@etatbak etatbak commented Feb 14, 2020

Great thanks!

@chienkan

This comment has been minimized.

Copy link

@chienkan chienkan commented Mar 3, 2020

I have followed the above steps to upgrade from older version of protoc to 3+. still I get protoc --version as "libprotoc 2.6.1".

I have the same problem, how did you solved this?

@chandiprasad

This comment has been minimized.

Copy link

@chandiprasad chandiprasad commented Sep 13, 2020

Thanks !! That works like a charm !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment