Linux – tar: Cannot create symlink : File exists

bashcompressionlinuxtar

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.

Best Answer

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.

Related Question