Extract tar the tar.bz2 file error

前端 未结 8 1111
后悔当初
后悔当初 2021-02-03 18:05

I tried to extract the tar.bz2 file in Fedora 17 OS. I used the command:

# tar -xvjf myfile.tar.bz2

I received this error message:

         


        
8条回答
  •  南方客
    南方客 (楼主)
    2021-02-03 18:39

    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 the tar command seems to be smart enough to figure this out.

提交回复
热议问题