Extract tar the tar.bz2 file error
Ensure that you have the bzip2
and bzip2-libs
RPMs installed.
It looks like the tar
command defers to the bzip2
command which the bzip2
RPM provides (/usr/bin/bzip2
). In your case, tar
specifically tries to call bzip2 -d
to decompress the bzipped archive.
Also, a couple of tips:
The
-v
option is not necessary. It just gives verbose output, which means that it lists the files that were extracted from the archive. Most of the time this prints useless data to your terminal.As @Skynet said, it is helpful to run the
file
command on your bzip2 archive to ensure that it is actually in bzip2 format.As @Odin said, it appears that you don't need to specify the
-j
option when extracting the archive, as thetar
command seems to be smart enough to figure this out.
I found the same error as you in CentOS 7. It looks like this:
tar -jxvf target_gile.tar.bz2 <br>tar (child): bzip2: Cannot exec: No such file or directory<br>tar (child): Error is not recoverable: exiting now<br>tar: Child returned status 2<br>tar: Error is not recoverable: exiting now
Then I installed bzip2 package : yum install bzip2
After that, I extracted again using this command: tar -jxvf target_gile.tar.bz2