• Contact Us
  • copyright
  • About Us
  • Privacy Policy
  • Devops
  • Linux
Globedrill

bzip2 command not found. Install bzip2 CentOS 7

Linux/23 May, 20/8360/0
Linux

ERROR : -bash: bzip2: command not found

 

I got ‘bzip2 command not found’ error on my centOS 7 server. On CentOS 7 and Redhat servers, bzip2 command is provided by bzip2 package. This package might not be installed on your Linux server.

root@server [~]# bzip2 -z file.txt
-bash: bzip2 command not found

bash: /usr/bin/bzip2: No such file or directory
 
 

How to Install bzip2 On CentOS 7 and RHEL 7 Server

 
1. Log into your Linux Server via SSH as root user

2. “rpm -qa | grep bzip2” command will show whether it is installed or not.

bzip2 package was not installed on my centos server.

3. You can install bzip2 package on your server using yum install command.

 

root@server [~]# rpm -qa | grep bzip2
root@server [~]#

root@server [~]# yum install bzip2
Resolving Dependencies
--> Running transaction check
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
bzip2 x86_64 1.0.6-13.el7 base 52 k

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

Total download size: 52 k
Installed size: 82 k
Is this ok [y/d/N]: y
Downloading packages:
bzip2-1.0.6-13.el7.x86_64.rpm | 52 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : bzip2-1.0.6-13.el7.x86_64 1/1
Verifying : bzip2-1.0.6-13.el7.x86_64 1/1

Installed:
bzip2.x86_64 0:1.0.6-13.el7

Complete!
root@server [~]#

 

Now bzip2 is installed on the server. Now you can try compressing and decompressing files using bzip2

4. Run the following command to verify installation by checking bzip2 version
 

root@server [~]# bzip2 --version
bzip2, a block-sorting file compressor. Version 1.0.6, 6-Sept-2010.

 
 

How to download and install bzip2 rpm on CentOS 7 and Redhat 7 server

 
1. Log into CentOS 7 server via SSH as ‘root’ user

2. Download bzip2 rpm file from CentOS website using wget command
 

# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/bzip2-1.0.6-13.el7.x86_64.rpm

 
3. You can install the downloaded package either using yum command or rpm command.

yum command will install the required dependencies.
 

# yum install bzip2-1.0.6-13.el7.x86_64.rpm

 
You must download and install the required dependency if you are installing using rpm command.
 

# rpm -ivh bzip2-1.0.6-13.el7.x86_64.rpm

 
 

Bzip2 command usage

 
usage: bzip2 [flags and input files in any order]

-h –help print this message
-d –decompress force decompression
-z –compress force compression
-k –keep keep (don’t delete) input files
-f –force overwrite existing output files
-t –test test compressed file integrity
-c –stdout output to standard out
-q –quiet suppress noncritical error messages
-v –verbose be verbose (a 2nd -v gives more)
-L –license display software version & license
-V –version display software version & license
-s –small use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k
–fast alias for -1
–best alias for -9

.

About Us

Globedrill.com is a website that publishes articles related to Linux and Devops. Globedrill was started on April 2016.

Contact Us

Email : globedrill.c@gmail.com

Globedrill

Copyright © 2016 Globedrill. All Rights Reserved. The content in this website is copyrighted to Globedrill.com and may not be republished either online or offline.

  • About Us
  • Privacy Policy
  • Contact Us
  • copyright