I've seen other questions related to this error (like Extracting a tar.gz file returns, “This does not look like a tar archive.”), but I'm not sure how to apply them to my problem:
First, download file:
$ wget --no-check-certificate https://wxpython.org/Phoenix/tools/doxygen-1.8.8-linux.bz2
--2017-04-06 15:06:11-- https://wxpython.org/Phoenix/tools/doxygen-1.8.8-linux.bz2
Resolving wxpython.org (wxpython.org)... 85.234.150.54
Connecting to wxpython.org (wxpython.org)|85.234.150.54|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3961996 (3.8M) [application/x-bzip2]
Saving to: ‘doxygen-1.8.8-linux.bz2’
100%[==============================================================================>] 3,961,996 734KB/s in 5.0s
2017-04-06 15:06:16 (778 KB/s) - ‘doxygen-1.8.8-linux.bz2’ saved [3961996/3961996]
Then, check file type of file:
$ file doxygen-1.8.8-linux.bz2
doxygen-1.8.8-linux.bz2: bzip2 compressed data, block size = 900k
Well, it's "bzip2 compressed data", let's unpack it?:
$ tar xjvf doxygen-1.8.8-linux.bz2
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains ‘\351\357\377I\211\304H\211’ where numeric mode_t value expected
tar: Archive contains ‘A\270\001\0\0\0H\211ǹ\001’ where numeric time_t value expected
tar: Archive contains ‘\307\350\216v)\0I\307’ where numeric uid_t value expected
tar: Archive contains ‘\004$P\254|\0\2770’ where numeric gid_t value expected
@\2678\350\330\351\357\377\2778
tar: @\2678\350\330\351\357\377\2778: Unknown file type '', extracted as normal file
tar: @�8������8: implausibly old time stamp 1970-01-01 00:59:59
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
And I get an empty file unpacked:
$ ls -la @�8������8
-rwxrwxr-x 1 user user 0 Jan 1 1970 @?8??????8
Strangely, if I use file-roller
(Archive Manager) and unpack from the GUI, I do get a file unpacked:
$ ls -la ~/Desktop/doxygen-1.8.8-linux
-rw-rw-r-- 1 user user 12283548 Apr 6 15:13 /home/user/Desktop/doxygen-1.8.8-linux
$ file ~/Desktop/doxygen-1.8.8-linux
/home/user/Desktop/doxygen-1.8.8-linux: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0eccee11d38322d5df3a1723651c2f18303e1188, not stripped
Ok, so what is going on here - why can't I unpack this from the command line, and how can I unpack this using the command line?
EDIT: actually I can unpack it with:
$ bzip2 -d doxygen-1.8.8-linux.bz2
$ file doxygen-1.8.8-linux
doxygen-1.8.8-linux: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0eccee11d38322d5df3a1723651c2f18303e1188, not stripped
... so the only question remaining is - why couldn't I have used tar
for this, as I had always otherwise done?
bzip2 -d doxygen-1.8.8-linux.bz2
bzcat doxygen-1.8.8-linux.bz2 | tar xjvf -
Thebzcat
command doesn't modify the compressed file on the hard drive; it just puts the uncompressed version on standard output for the tar command to process on the other end of the pipe. This is a good thing to learn to do, because uncompressed tar files tend to be quite large, and typically occupy more disk space than the individual files combined, due to blocking that is only relevant for tape archives (whencetar
is named).tar
file. The only way this file is useful is if he decompresses it.