tar: Cannot create symlink : File exists

6,949

The solution I found for this was to not use the Gnome package manager, but rather to use the terminal command:

tar -czf myproject.tar.gz myoriginalproject

You should then be able to unpack the tarball as you do in your question but without those pesky errors.

This seems to be an issue with the Gnome package manager. When I created a tarball with it, then inspected it with the archive manager, it seemed that the symlinks had actually been populated with the contents of the target directory, and the target directory was empty.

Hope this helps.

Share:
6,949

Related videos on Youtube

gladman
Author by

gladman

I work on embedded system, android, Qt. My techinolgies and main targets are Linux, android, Qt, C, C++, java

Updated on September 18, 2022

Comments

  • gladman
    gladman over 1 year

    I backup lots of gigebytes files in to myproject.tar.gz, and compress success without errors. Now, I want to decompress all to an folder "myprojects".

    adan@adan-Latitude-D630:~$ tar zxf myproject.tar.gz  -C myprojects/
    tar: myproject/androidsource/prebuilts/ndk/current: Cannot create symlink to ‘8’: File exists
    tar: myproject/androidsource/uboot/include/configs/amlogic:  Cannot open : File exists
    tar: Exiting with failure status due to previous errors
    

    It is my first decompression, and the folder is empty, I am sure the file is not exist in "myprojects" folder when decompressing, why are these errors happened? how to uncompress my backup file without errors? Could I ingnore it without any harmful?

    thanks for your help.

    • Barmar
      Barmar about 10 years
      Sounds like the tar file has duplicate entries for some names. Show how you created the file.
    • gladman
      gladman about 10 years
      I create the tar file using gnome package manager. right click the target folder, and compressed it.
    • Raúl Salinas-Monteagudo
      Raúl Salinas-Monteagudo over 9 years
      Are you possibly untarring it to a filesystem that does not support symbolic links?
  • Gergely
    Gergely over 2 years
    I have a similar problem but I downloaded the tarball from a project site, so re-packaging it is not an option. I get the cannot create symlink message. What can I do?