xz command not found – CentOS 8

xz command not found – CentOS 8

 

Got the below error on my CentOS 8 server. Follow the below steps to installl xz package.
 

Step 1 : Log into CentOS 8 server as ‘root’ user

Step 2 : Run the command ‘rpm -qa | grep -i xz’ to check whether xz is already installed or not

 

[root@linux /]# rpm -qa | grep -i xz
[root@linux /]#

 

Steps 3 : Run the command ‘yum install xz’ to install xz package

 

[root@linux /]# yum install xz

Dependencies resolved.
===================================================================================================
Package Architecture Version Repository Size
===================================================================================================
Installing:
xz x86_64 5.2.4-3.el8 BaseOS 153 k

Transaction Summary
===================================================================================================
Install 1 Package

Total download size: 153 k
Installed size: 423 k
Is this ok [y/N]:y

 

Steps 4 : Enter ‘y’ and press enter if yum ask for confirmation while installing the package

 
 

How to download and install xz rpm

 

Step 1 : Log into CentOS 8 server as ‘root’ user

Step 2 : You can download xz rpm file from CentOS website using wget command

 

wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/xz-5.2.4-3.el8.x86_64.rpm

 

Step 3 : Install the required dependencies of xz package and install xz package using rpm command

 

rpm-Uvh xz-5.2.4-3.el8.x86_64.rpm