Installing Protobuf
CentOS
- Install Protobuf.
1yum install -y protobuf protobuf-devel
- Check whether Protobuf is installed successfully.
1protoc --versionThe installation is successful if information similar to the following is displayed:

- Deploy Protoc in the local Maven repository.
1mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=2.5.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc
openEuler
- Download and decompress the source code.
1 2
wget https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz tar -zxf protobuf-2.5.0.tar.gz
- Move the decompressed directory to the /opt/tools/installed/ directory.
1mv protobuf-2.5.0 /opt/tools/installed/
- Go to the /opt/tools/installed/ directory.
1cd /opt/tools/installed
- Download the protoc.zip package and decompress it to obtain the protoc.patch file whose storage path can be specified.
1 2 3
wget https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/bigdata/Patch/protoc.zip unzip protoc.zip cp ./protoc/protoc.patch ./protobuf-2.5.0/src/google/protobuf/stubs/
- Go to the protobuf-2.5.0/src/google/protobuf/stubs/ directory and install the patch.
1 2
cd protobuf-2.5.0/src/google/protobuf/stubs/ patch -p1 < protoc.patch
- Go back to the root directory of protobuf-2.5.0, compile the file, and install it in the default directory.
1 2
cd /opt/tools/installed/protobuf-2.5.0 ./autogen.sh && ./configure CFLAGS='-fsigned-char' && make -j8 && make install
- Deploy Protoc in the local Maven repository.
1mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=2.5.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=/usr/local/bin/protoc
Parent topic: Configuring the Compilation Environment