How do I install protobuf 2.5 on Arch Linux for compiling hadoop 2.6.0 using maven 3.3.1? How do I install protobuf 2.5 on Arch Linux for compiling hadoop 2.6.0 using maven 3.3.1? hadoop hadoop

How do I install protobuf 2.5 on Arch Linux for compiling hadoop 2.6.0 using maven 3.3.1?


Compiling Google's protobuf is pretty easy.I originally found out how to do it on this blog post while compiling hadoop myself.

But here is my version:

$ cd /usr/local/src/$ wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz$ tar xvf protobuf-2.5.0.tar.gz$ cd protobuf-2.5.0$ ./autogen.sh$ ./configure --prefix=/usr$ make$ make install$ protoc --version

Install protobuf for java

$ cd java$ mvn install$ mvn package

You should be good to go.

To enable you to install different versions of protobuf, install stowthen change ./configure --prefix=/usr to ./configure --prefix=/usr/local/stow/protobuf-2.5.0

Then link protobuf into your system with stow:

$ cd /usr/local/stow$ stow protobuf-2.5.0

Note: stow uses /usr/local/bin by default. Make sure thats in your $PATH

To unlink that version of protobuf,

$ stow -D protobuf-2.5.0

Hope this helped.


I wonder why the above answer got downvoted,even I had to perform few more steps (in addition to the accepted answer by Rudker) to get protobuf 2.5 installed on Ubuntu Xenial.

Leaving the additional steps here for everyone's benefit:

apt-get install autoconf in response to the error : ./autogen.sh: autoreconf: not found for command : ./autogen.sh

apt-get install libtool in response to the error : autoreconf: libtoolize is needed because this package uses Libtool for command : ./autogen.sh

apt install g++ in response to the error : configure: error: C++ preprocessor "/lib/cpp" fails sanity check for command : ./configure --prefix=/usr


An easier but not future proof solution (for future queries) would be to head over to Arch Linux Archives: http://seblu.net/a/archive/packages/p/protobuf/

Uninstall the newer version of protobuf and install the downloaded package via pacman -U protobuf-2.5.x..

Though whenever you upgrade the Arch Linux packages via pacman you'd need to ensure you are doing: sudo pacman -Syu --ignore protobuf