How To Install protobuf on CentOS 8

protobuf is Protocol Buffers - Google’s data interchange format Protocol Buffers - Google’s data interchange format

Introduction

In this tutorial we learn how to install protobuf on CentOS 8.

What is protobuf

Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data \u2013 think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the “old” format. protobuf 3.5.0 13.el8 x86_64 892 k protobuf-3.5.0-13.el8.src.rpm appstream Protocol Buffers - Google’s data interchange format https BSD Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data \u2013 think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the “old” format.

We can use yum or dnf to install protobuf on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install protobuf.

Install protobuf on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install protobuf using dnf by running the following command:

sudo dnf -y install protobuf

Install protobuf on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install protobuf using yum by running the following command:

sudo yum -y install protobuf

How To Uninstall protobuf on CentOS 8

To uninstall only the protobuf package we can use the following command:

sudo dnf remove protobuf

protobuf Package Contents on CentOS 8

/usr/lib/.build-id
/usr/lib/.build-id/57
/usr/lib/.build-id/57/045915bab9d4e75bf98317926c98fc99316dc1
/usr/lib64/libprotobuf.so.15
/usr/lib64/libprotobuf.so.15.0.0
/usr/share/doc/protobuf
/usr/share/doc/protobuf/CHANGES.txt
/usr/share/doc/protobuf/CONTRIBUTORS.txt
/usr/share/doc/protobuf/README.md
/usr/share/licenses/protobuf
/usr/share/licenses/protobuf/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/71
/usr/lib/.build-id/71/adc4ab8afdbc8bed01b7a04fe8e3a1c7a6bc29
/usr/lib/libprotobuf.so.15
/usr/lib/libprotobuf.so.15.0.0
/usr/share/doc/protobuf
/usr/share/doc/protobuf/CHANGES.txt
/usr/share/doc/protobuf/CONTRIBUTORS.txt
/usr/share/doc/protobuf/README.md
/usr/share/licenses/protobuf
/usr/share/licenses/protobuf/LICENSE

References

Summary

In this tutorial we learn how to install protobuf on CentOS 8 using yum and dnf.