Thursday, December 29, 2016

bzip2: Cannot exec: No such file or directory

Error when trying to create tar.bz2 Archive File in CentOS 7

The following is the error output when trying to create tar.bz2 file in CentOS7:

$ tar cvfj testfile.tar.bz2 ./testfile*
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
$

First step is to check if the package is installed or not.
$ sudo yum list installed | grep bzip2

If package is not installed, please run the following:
# yum install bzip2
# exit

Then create tar.bz2 file.
$ tar cvfj testfile.tar.bz2 ./testfile*

No comments:

Post a Comment