When I extract the archive Symfony_Standard_2.2.1.tgz using this command:

$ tar xzf /home/tomas/downloads/Symfony_Standard_2.2.1.tgz

I always get the errors:

tar: doctrine.php: Cannot create symlink to `../vendor/doctrine/orm/bin/doctrine.php': Operation not supported
tar: doctrine: Cannot create symlink to `../vendor/doctrine/orm/bin/doctrine': Operation not supported
tar: Exiting with failure status due to previous errors

Why is it failing to create the symlinks?

$ tar --version
tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 6.0.7 (squeeze)
Release:        6.0.7
Codename:       squeeze
  • 5
    To which filesystem are you extracting? I'm guessing it's one that doesn't support symlinks? Like FAT – BloodPhilia Apr 17 '13 at 16:29

BloodPhilia's comment said it all. I didn't consider the fact that I'm working on a VMware shared folder from a Windows machine with NTFS partitions. Extracting the archive anywhere on the virtual machine works fine.


I'm coming a bit late to this party, but had the same problem yesterday. If the filesystem does not support symlinks and you despite want all the contents from the archive to be accessible, it might be a workaround to copy those files (which should be symlinked).

The archive I wanted to extract had 20+ symlinks, so I decided to generate the cpcommands by a script. I just need to provide the stderr output of tar (via a file by tar ... 2> /tmp/tar-stderr.txt) and the target folder. I decided to not yet execute the cp commands, but pipe them to a file which I can check before I chmod +x and execute it. Feel free to improve the script, pipe tar directly to it (e.g. by exchanging stdout/stderr), use somehow tee to provide the ignored messages of tar...

(export DIR=/your/extraction/target/directory; echo \#\!/bin/sh -e; cat /tmp/tar-stderr.txt | grep 'Cannot create symlink to' | sed -e 's7^tar: \.\([^:]\+\): Cannot create symlink to .\([^:]\+\).*$7\1:\27' -e "s7^\(.\+\)/\([^:]\+\):\(.\+\).\$7cd $DIR\1 \&\& cp \3 \2;7")

EDIT: Explanation of script added:

The grep filters the lines of interest. My sed commands are simple, but use 7 as field delimiter instead of the common /. With this I can search for and/or write /.

The first sed expression filters the relevant information (relative path and the 2 filenames) and puts a : as delimiter. The second distinguishes filename from path and throws away the ' at the very end; the final output then is a cp command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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