Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-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 chwon [user] /usr/local/bin/protoc
sudo chwon -R [user] /usr/local/include/google
@dminGod

This comment has been minimized.

Show comment
Hide comment
@dminGod

dminGod May 1, 2017

Awesome! : )

dminGod commented May 1, 2017

Awesome! : )

@afcastano

This comment has been minimized.

Show comment
Hide comment
@afcastano

afcastano May 17, 2017

The problem with the last step is that the types like Timestamp are not loaded.
I did change the last step to:
ln -s /protoc3/bin/protoc /usr/bin/protoc

That fixed the problem!

afcastano commented May 17, 2017

The problem with the last step is that the types like Timestamp are not loaded.
I did change the last step to:
ln -s /protoc3/bin/protoc /usr/bin/protoc

That fixed the problem!

@mathben

This comment has been minimized.

Show comment
Hide comment
@mathben

mathben commented May 25, 2017

@steven-ferrer

This comment has been minimized.

Show comment
Hide comment
@steven-ferrer

steven-ferrer May 29, 2017

@afcastano, that means I still need to maintain the protoc3/bin/protoc file right? since deleting It would cause problems

steven-ferrer commented May 29, 2017

@afcastano, that means I still need to maintain the protoc3/bin/protoc file right? since deleting It would cause problems

@alecholmez

This comment has been minimized.

Show comment
Hide comment
@alecholmez

alecholmez Jun 12, 2017

Wait.. you can't symlink it if an earlier version of protoc exist.

alecholmez commented Jun 12, 2017

Wait.. you can't symlink it if an earlier version of protoc exist.

@charan223

This comment has been minimized.

Show comment
Hide comment
@charan223

charan223 Jun 21, 2017

you are awesome

charan223 commented Jun 21, 2017

you are awesome

@fisheess

This comment has been minimized.

Show comment
Hide comment
@fisheess

fisheess Jun 23, 2017

best solution on github!

fisheess commented Jun 23, 2017

best solution on github!

@fractalDimension

This comment has been minimized.

Show comment
Hide comment
@fractalDimension

fractalDimension commented Jul 10, 2017

Thank you!

@imbur

This comment has been minimized.

Show comment
Hide comment
@imbur

imbur Aug 13, 2017

Thank you!
There are a typos in line 14 and line 15: chown is misspelled.

imbur commented Aug 13, 2017

Thank you!
There are a typos in line 14 and line 15: chown is misspelled.

@jtavara23

This comment has been minimized.

Show comment
Hide comment
@jtavara23

jtavara23 commented Aug 23, 2017

great!

@vCloudernBeer

This comment has been minimized.

Show comment
Hide comment
@vCloudernBeer

vCloudernBeer Sep 6, 2017

@afcastano which step you are referring to as the last step is changed to "ln -s /protoc3/bin/protoc /usr/bin/protoc". Seems like the last step is "sudo mv protoc3/include/* /usr/local/include/". Or you are adding this as the last step?

I followed the steps and did not encounter any problem. thanks for the information. :)

vCloudernBeer commented Sep 6, 2017

@afcastano which step you are referring to as the last step is changed to "ln -s /protoc3/bin/protoc /usr/bin/protoc". Seems like the last step is "sudo mv protoc3/include/* /usr/local/include/". Or you are adding this as the last step?

I followed the steps and did not encounter any problem. thanks for the information. :)

@rvegas

This comment has been minimized.

Show comment
Hide comment
@rvegas

rvegas Sep 19, 2017

@sofyanhadia You have a typo on:

# Optional: change owner
sudo chwon [user] /usr/local/bin/protoc
sudo chwon -R [user] /usr/local/include/google

Change chwon to chown 😏

rvegas commented Sep 19, 2017

@sofyanhadia You have a typo on:

# Optional: change owner
sudo chwon [user] /usr/local/bin/protoc
sudo chwon -R [user] /usr/local/include/google

Change chwon to chown 😏

@yurkazaytsev

This comment has been minimized.

Show comment
Hide comment
@yurkazaytsev

yurkazaytsev commented Oct 18, 2017

Thanks!

@bedge

This comment has been minimized.

Show comment
Hide comment
@bedge

bedge Nov 4, 2017

Latest is now https://github.com/google/protobuf/releases/download/v3.4.0/protoc-3.4.0-linux-x86_64.zip
Also, recommend 'stow' utility for managing non-packaged components.
e.g.:

 %> sudo stow -n cproto -D /usr/local -d /usr/local/stow
Loading defaults from /root/.stowrc
LINK: include/google => ../stow/cproto/include/google
LINK: readme.txt => stow/cproto/readme.txt
LINK: bin/protoc => ../stow/cproto/bin/protoc

Avoids the need to manually copy/link, plus manages what's been added in this manner for later removal/upgrade/etc.

bedge commented Nov 4, 2017

Latest is now https://github.com/google/protobuf/releases/download/v3.4.0/protoc-3.4.0-linux-x86_64.zip
Also, recommend 'stow' utility for managing non-packaged components.
e.g.:

 %> sudo stow -n cproto -D /usr/local -d /usr/local/stow
Loading defaults from /root/.stowrc
LINK: include/google => ../stow/cproto/include/google
LINK: readme.txt => stow/cproto/readme.txt
LINK: bin/protoc => ../stow/cproto/bin/protoc

Avoids the need to manually copy/link, plus manages what's been added in this manner for later removal/upgrade/etc.

@Arfey

This comment has been minimized.

Show comment
Hide comment
@Arfey

Arfey commented Dec 21, 2017

Thx

@aescart1

This comment has been minimized.

Show comment
Hide comment
@aescart1

aescart1 commented Dec 30, 2017

great

@sailfish009

This comment has been minimized.

Show comment
Hide comment
@sailfish009

sailfish009 Jan 20, 2018

thanks for the info!

sailfish009 commented Jan 20, 2018

thanks for the info!

@sleebapaul

This comment has been minimized.

Show comment
Hide comment
@sleebapaul

sleebapaul Mar 22, 2018

it is giving the following error -bash: /usr/local/bin/protoc: cannot execute binary file: Exec format error

sleebapaul commented Mar 22, 2018

it is giving the following error -bash: /usr/local/bin/protoc: cannot execute binary file: Exec format error

@rahuldeo2047

This comment has been minimized.

Show comment
Hide comment
@rahuldeo2047

rahuldeo2047 Apr 12, 2018

Just thought it might be useful to mates, stuck with multiple protobuf versions runtime issue:
protocolbuffers/protobuf#4001

So that we check if there is already a version installed.

rahuldeo2047 commented Apr 12, 2018

Just thought it might be useful to mates, stuck with multiple protobuf versions runtime issue:
protocolbuffers/protobuf#4001

So that we check if there is already a version installed.

@edwardmartinsjr

This comment has been minimized.

Show comment
Hide comment
@edwardmartinsjr

edwardmartinsjr commented Apr 30, 2018

Awesome!

@bigdataplot

This comment has been minimized.

Show comment
Hide comment
@bigdataplot

bigdataplot May 3, 2018

Fixed my problem :) Thx

bigdataplot commented May 3, 2018

Fixed my problem :) Thx

@jeshan

This comment has been minimized.

Show comment
Hide comment
@jeshan

jeshan May 11, 2018

thanks. consider changing [user] to $USER to make it runnable immediately. also the "chwon" has already been reported above.

jeshan commented May 11, 2018

thanks. consider changing [user] to $USER to make it runnable immediately. also the "chwon" has already been reported above.

@xiadeye

This comment has been minimized.

Show comment
Hide comment
@xiadeye

xiadeye May 29, 2018

should add ln -s /usr/local/bin/protoc /usr/bin/protoc

xiadeye commented May 29, 2018

should add ln -s /usr/local/bin/protoc /usr/bin/protoc

@deepkshikha

This comment has been minimized.

Show comment
Hide comment
@deepkshikha

deepkshikha commented Jul 12, 2018

Thanks

@purusothaman2502

This comment has been minimized.

Show comment
Hide comment
@purusothaman2502

purusothaman2502 Jul 15, 2018

redhat@redhat-HP-245-G5-Notebook-PC:~$ sudo chown [redhat] /usr/local/bin/protocchown: invalid user: ‘[redhat]’
how to solve this error?? ple help me :::))

purusothaman2502 commented Jul 15, 2018

redhat@redhat-HP-245-G5-Notebook-PC:~$ sudo chown [redhat] /usr/local/bin/protocchown: invalid user: ‘[redhat]’
how to solve this error?? ple help me :::))

@sushant1727

This comment has been minimized.

Show comment
Hide comment
@sushant1727

sushant1727 Jul 19, 2018

@purusothaman2502 remove the [ ] for your user.

Command becomes sudo chown redhat /usr/local/bin/protocchown

sushant1727 commented Jul 19, 2018

@purusothaman2502 remove the [ ] for your user.

Command becomes sudo chown redhat /usr/local/bin/protocchown

@noshky

This comment has been minimized.

Show comment
Hide comment
@noshky

noshky Jul 20, 2018

How can I update the library too?
Cmake gives me:
Protobuf compiler version 3.3.0 doesn't match library version 3.0.0
(on ubuntu-bionic)

noshky commented Jul 20, 2018

How can I update the library too?
Cmake gives me:
Protobuf compiler version 3.3.0 doesn't match library version 3.0.0
(on ubuntu-bionic)

@Jomes

This comment has been minimized.

Show comment
Hide comment
@Jomes

Jomes Jul 25, 2018

Thank you!
There are a typos in line 14 and line 15: chown is misspelled.

Jomes commented Jul 25, 2018

Thank you!
There are a typos in line 14 and line 15: chown is misspelled.

@shriAG

This comment has been minimized.

Show comment
Hide comment
@shriAG

shriAG Jul 30, 2018

Hi How to install google protobuf along with protoc ?

shriAG commented Jul 30, 2018

Hi How to install google protobuf along with protoc ?

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