View Full Version : Suspecting a bug in tar commmand supplied in OSX Lion; can someone confirm?

May 29, 2012, 03:38 PM
I'm trying to extract the ubuntu-12.04-alternate-i386.iso

$ curl --output ubuntu-12.04-alternate-i386.iso -L http://releases.ubuntu.com/precise/ubuntu-12.04-alternate-i386.iso
$ md5 -q ubuntu-12.04-alternate-i386.iso

A quick look at https://help.ubuntu.com/community/UbuntuHashes verifies that the file isn't corrupt. So I try

$ tar -xvf ubuntu-12.04-alternate-i386.iso

and nothing happens. Zero output. No files, nothing on stdout.

Weird. I check the version

$ tar --version
bsdtar 2.8.3 - libarchive 2.8.3

and see if it may have been updated. And indeed, libarchive has been updated to 3.0.4. homebrew doesn't support it directly, because its duplicating os behavior. So I created my own updated version of libarchive for 3.0.4. and submitted a pull request to the adamv/homebrew-dupes repository (which accepts duplicates). So:

$ brew install https://raw.github.com/oschrenk/homebrew-dupes/edbc2b464d0bf4420508297418481178299f420a/libarchive.rb

$ /usr/local/bin/bsdtar --version
bsdtar 3.0.4 - libarchive 3.0.4
$ /usr/local/bin/bsdtar -xvf ubuntu-12.04-alternate-i386.iso

And it works fine.

Can somebody confirm that system tar is not working with the given tar by downloading the file, checking its hash value and trying to extract the iso? Basically please run:

$ curl --output ubuntu-12.04-alternate-i386.iso -L http://releases.ubuntu.com/precise/ubuntu-12.04-alternate-i386.iso
$ md5 -q ubuntu-12.04-alternate-i386.iso
$ tar --version
$ tar -xvf ubuntu-12.04-alternate-i386.iso

and report if the file is being extracted.

Mr. Retrofire
May 29, 2012, 03:54 PM
A bug? tar is for tar files, not for iso files!


May 29, 2012, 03:58 PM
@Mr. Retrofire

BSD tar has always supported extracting files from isos (GNU tar doesn't). It does in Snow Leopard (I just double checked). My Snow Leopard tar is version 2.6.2, Lion is 2.8.3.

tar doesn't work for doing this in Lion, as the OP said.

May 29, 2012, 03:58 PM
$ man tar
tar creates and manipulates streaming archive files. This implementation
can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
and can create tar, pax, cpio, ar, and shar archives.

Thanks. I'm opening a bug report at https://bugreport.apple.com/ but the'll probably will only update it when they ship Mountain Lion

Nov 8, 2012, 07:56 PM
Thanks for reporting this!
had SAME issue, but solved thanks to you!

Dec 10, 2012, 10:24 AM
I've been experiencing this problem on and off for the better part of a year now. I wish I could tell you that I found the solution but apparently I haven't. I will say that those of you using a mail.com account can go to Safari (doesn't work well in Chrome) and log into icloud.com. You can lot into your account and "send" emails that way.

This problem has occured, as I said, several times over the past 7 or 8 months. Once, about 2 months ago I contacted Apple and a rep guided me through basically resetting up my .mac mail account. When he finished all was great.... until yesterday morning. It started screwing up again. I managed to somehow straighten it out again (as one reply indicated) but I don't know how I even did it other than it just started working again.

I'm running Snow Leopard 10.6.8 and had been considering upgrading to Lion until I've read everything that everyone has said about Lion.... now I don't think I want to go there yet.

I'm not with AT&T I'm with Time Warner but am still having this problem. When it occurs with my laptop, the problem also seems to be present on my office iMac that is located about 35 miles away but that's also Time Warner.

I hope someone finds a solution to this pain soon.

Aug 10, 2013, 09:21 AM
Download this:

cd [location of download]
tar jxvf tar-1.26.tar.bz2

./configure --prefix=/usr --program-prefix=gnu
sudo make install

which gnutar
[should see /usr/bin/gnutar at this point...]

Now you have both GNU and BSD tar.