Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I tar up files on my Macbook and untar them in Linux, I repeatedly get the following warnings/errors:


 tar: Ignoring unknown extended header keyword `SCHILY.ino'
 tar: Ignoring unknown extended header keyword `SCHILY.nlink'
 tar: Ignoring unknown extended header keyword `SCHILY.dev'
 tar: Ignoring unknown extended header keyword `SCHILY.ino'
 tar: Ignoring unknown extended header keyword `SCHILY.nlink'
 tar: Ignoring unknown extended header keyword `SCHILY.dev'
 tar: Ignoring unknown extended header keyword `SCHILY.ino'
 tar: Ignoring unknown extended header keyword `SCHILY.nlink'
 tar: Ignoring unknown extended header keyword `SCHILY.dev'
 tar: Ignoring unknown extended header keyword `SCHILY.ino'
 tar: Ignoring unknown extended header keyword `SCHILY.nlink'
 tar: Ignoring unknown extended header keyword `SCHILY.dev'
 tar: Ignoring unknown extended header keyword `SCHILY.ino'
 tar: Ignoring unknown extended header keyword `SCHILY.nlink'
 tar: Ignoring unknown extended header keyword `SCHILY.dev'
 tar: Ignoring unknown extended header keyword `SCHILY.ino'
 tar: Ignoring unknown extended header keyword `SCHILY.nlink'
 tar: Error exit delayed from previous errors

Fortunately, this does NOT affect the files stored in the archive, which are restored perfectly. However, it does cause problems in a number of scenarios, especially when dealing with build processes where the non-zero failure code returned by 'tar' causes builds and installs to stop unnecessarily.

How can I get OS X to build tar files that play nicely with the rest of the Linux world?

Also, for bonus points, there exists a publicly distributed tar file with these issues. Is there any way to get Linux to handle the tar file gracefully without changing the way it was originally compressed?

share|improve this question

migrated from stackoverflow.com Aug 4 '11 at 1:49

This question came from our site for professional and enthusiast programmers.

5 Answers 5

up vote 23 down vote accepted

I googled for the error message and it seems like a BSD tar vs. GNU tar issue.

Install gnu tar if you can on MacOS and use that to create the tar.

share|improve this answer
9  
Mac OS X 10.6 uses a BSD tar by default but also ships with a gnutar at /usr/bin/gnutar. –  Ned Deily Aug 3 '11 at 22:03
    
@Ned. Thx. that's good info. –  Dave Dopson Aug 4 '11 at 0:31
3  
FYI : /usr/bin/gnutar is not shipped anymore with Mac OS X (at least as of Mavericks) –  foobar Nov 27 '13 at 13:52

If you are using maveriks, then gnutar is no longer available.

The work around if you use homebrew is to execute the following

brew install gnu-tar
ln -s /usr/local/bin/gtar /usr/local/bin/gnutar

Source:
https://github.com/jordansissel/fpm/issues/576

share|improve this answer

Yea, Mac's built-in tar binary adds a bunch of extra stuff that CentOS doesn't like. To fix this do the following:

sudo mv /usr/bin/tar /usr/bin/darwintar
sudo ln -s /usr/bin/gnutar /usr/bin/tar
ls -l /usr/bin/tar

Hope that helps!

share|improve this answer
    
That's one way. I solved the GNU/BSD issue more comprehensively in github.com/ddopson/dotfiles. I have ~/bin/coreutils early in the path and there's small shims in there like github.com/ddopson/dotfiles/blob/master/bin/coreutils/tar that pick the correct executable based on linux vs Mac and if the COREUTILS environment variable is set –  Dave Dopson Feb 8 '13 at 2:24
    
You might want to modify your instructions to tell people to check for the existence of /usr/bin/gnutar before moving their working tar. Newbies can find this using google and not know how to un-break their system. –  msouth May 15 at 15:18

MacOSX comes with gnutar already. If you want a quick and dirty solution add this to ~/.bash_profile

alias tar='gnutar'

and run source ~/.bash_profile to update

Additionally, OSX ships with both GNU and BSD tar. So you can also unlink the ref of tar from bsd to gnu:

sudo unlink /usr/bin/tar;
sudo ln -s /usr/bin/gnutar /usr/bin/tar
share|improve this answer
1  
Why in /etc/hosts? /etc/hosts is for host/IP mapping, right? –  BenjiWiebe Feb 21 '13 at 16:47
1  
what @BenjiWiebe said. The even odder bit is editing /etc/hosts. I think you meant ~/.bashrc –  Dave Dopson Feb 21 '13 at 17:57
2  
On OS X, .bashrc isn't loaded for Terminal sessions. You need .bash_profile, since a login shell is started with a new Terminal window. /cc @BenjiWiebe –  slhck Feb 21 '13 at 19:32
    
Correct :-) I was also working in /etc/hosts at that time so it spewed onto the keyboard. Good catch –  Du3 Feb 25 '13 at 9:52

okay, I used Google search, but top three link confirmed what I suspected
1. Bug in your tar AND/OR
2. Incompatibility between the two tar utilities
See this link. There someone reports that "Using "bsdtar -xvf" worked."
Edit : You are on Mac system, I thought other way round.
You will need to use gnutar, it should be installed already, if not get it installed.
Of course, you can look at other links by searching yourself :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.