Install gzip on CentOS / RHEL server

Error :

bash: gunzip: command not found
bash: gzip: command not found
bash: gzexe: command not found
bash: zcat: command not found
bash: zcmp: command not found
bash: zdiff: command not found
bash: zegrep: command not found
bash: zfgrep: command not found
bash: zforce: command not found
bash: zgrep: command not found
bash: zless: command not found
bash: zmore: command not found
bash: znew: command not found

I got the above error on my CentOS 7 server. Gzip is a software used on Linux servers to compress and decompress data.

Gzip package will be installed by default on centOS 6, CentOS 7 and CentOS 8 servers. You will get the above error if you have accidentally removed the package from the server. If gzip package is already installed, then the error might be due to path of the binary.

Do the below steps to install gzip on your server.

 

Install gzip using yum

1. Log into your CentOS / Redhat server as ‘root’ user

2. Run the command ‘yum install gzip’ to install gzip package

3. Enter ‘y’ and press enter, if yum ask for confirmation while installing

 

Download and install gzip rpm

1. Log into your linux server as ‘root’ user

2. Download the gzip rpm package from ‘rpmfind.net’ website using wget command

Gzip rpm for CentOS 6 / RHEL 6 x86_64 server :

wget http://rpmfind.net/linux/centos/6.10/os/x86_64/Packages/gzip-1.3.12-24.el6.x86_64.rpm

Gzip rpm for CentOS 7 / RHEL 7 x86_64 server :

wget rpmfind.net/linux/centos/7.7.1908/os/x86_64/Packages/gzip-1.5-10.el7.x86_64.rpm

3. Install the downloaded rpm

rpm -ivh gzip-1.5-10.el7.x86_64.rpm