How to install lz4 shared libraries in rpm based machines?

stack512 picture stack512 · Jan 13, 2015 · Viewed 15.9k times · Source

I tried to install lz4 libraries in CentOS, but failing with the following error.

[Bash]# yum install liblz4 liblz4-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net 
 * extras: centos.excellmedia.net 
 * updates: centos.excellmedia.net 
No package liblz4 available. 
No package liblz4-devel available. 
Error: Nothing to do 
[Bash]#

What is the right way to setup the liblz4.so?

Also, I am not able to find the lz4 rpm packages for CentOS, but available for other rpm based Operating Systems. Is lz4 supported for CentOS?

Answer

JJC picture JJC · Mar 4, 2015

On CentOS 6.x or 7.x, you can do the following to easily install lz4 using the package manager.

As root (sudo su - is your friend, or just preface each yum invocation below with sudo):

First, enable EPEL, as @Etan Reisner suggested:

yum install epel-release

Then, to install lz4 binary:

yum install lz4

And/or, to install the library:

yum install lz4-devel

And, you're done.