2

I downloaded a file from lynx sources site:

http://invisible-mirror.net/archives/lynx/tarballs/?C=M;O=D

Specifically this file: lynx2.8.8rel.2.tar.bz2 (tried several from the site).

When I apply tar xjf to the file I receive the following error:

bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now

However, if I use Ubuntu (16.04) "File" application all goes well. Any suggestions as to why that is the case?

andrew.46
  • 37,085
  • 25
  • 149
  • 228
amalafrida
  • 23
  • 3

1 Answers1

3

First check the md5sum of the file:

md5sum lynx2.8.8rel.2.tar.bz2 
b231c2aa34dfe7ca25681ef4e55ee7e8  lynx2.8.8rel.2.tar.bz2

And if this is correct any of the following commands should work without fail on a default installation of Ubuntu:

tar xvf lynx2.8.8rel.2.tar.bz2
bzcat -dk lynx2.8.8rel.2.tar.bz2 | tar xvf -
bzip2 -dck lynx2.8.8rel.2.tar.bz2 | tar xvf -

(The j option to call bzip2, which you have used in your own commandline, is not normally required by tar in modern versions.)

If the md5sum is different from the one I have given above this will indicate that there is something amiss with the download process and the archive itself rather than a problem with either the tar or bzip2 applications...

Note:

If using lynx to download this particular file (which I believe you have been attempting): on my system, using Lynx Version 2.8.8rel.2 the following produced a good download when tested with md5sum:

lynx -source \
'http://invisible-mirror.net/archives/lynx/tarballs/lynx2.8.8rel.2.tar.bz2' \
> lynx2.8.8rel.2.tar.bz2

References:

andrew.46
  • 37,085
  • 25
  • 149
  • 228
  • $ tar xvf lynx2.8.8rel.2.tar.bz2 tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors – amalafrida Jul 16 '16 at 03:56
  • bzip2 --version bzip2, a block-sorting file compressor. Version 1.0.6, 6-Sept-2010. – amalafrida Jul 16 '16 at 03:58
  • correct previous comment. should be: $ tar xjvf lynx2.8.8rel.2.tar.bz2 – amalafrida Jul 16 '16 at 04:05
  • @amalafrida What happens with: `bzcat -dk lynx2.8.8rel.2.tar.bz2 | tar xvf -` ? This is a simple variation of `bzip2 -dck lynx2.8.8rel.2.tar.bz2 | tar xvf -` and might work around the odd problem you are experiencing... – andrew.46 Jul 16 '16 at 04:19
  • bzcat -dk lynx2.8.8rel.2.tar.bz2 | tar xvf reports: tar: Old option 'f' requires an argument. Try 'tar --help' or 'tar --usage' for more information. bzcat: lynx2.8.8rel.2.tar.bz2 is not a bzip2 file. – amalafrida Jul 16 '16 at 04:33
  • @amalafrida You have left off the final `-` which is the signal to tar to use the input coming through the pipe :) But sounds like bzcat is failing anyway. Check the md5sum for the file: `b231c2aa34dfe7ca25681ef4e55ee7e8 lynx2.8.8rel.2.tar.bz2` on my system – andrew.46 Jul 16 '16 at 05:20
  • 1
    ok. that solves it. checked md5sum on my file. did not match yours. downloaded (wget), ran md5sum, got match, tar xf ... works fine. however, exceedingly curious ... navigated to http://invisible-mirror.net/archives/lynx/tarballs/lynx2.8.8rel.2.tar.bz2 and downloaded via my lynx browser connection ... same error! would like to track that problem down. take it up with lynx developers??? any advice? in any case, problem solved (sorta). thanks much for your help. new to ubuntuhelp. do i upvote or mark as solved? – amalafrida Jul 16 '16 at 08:21
  • @amalfrida Mark as solved and upvote if you are especially pleased :). Sorry I did not think of the md5sum solution earlier but it took me to bzcat which I have not met before, so I have learnt something new! Don't report to the developers as I suspect it is not a problem at their end... – andrew.46 Jul 16 '16 at 08:36
  • @amalafrida I tested with lynx and achieved a good download, added the detals to my answer... – andrew.46 Jul 16 '16 at 10:28