LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   a tough question 4 u, problem in extracting tar & tar.gz files (http://www.linuxquestions.org/questions/linux-general-1/a-tough-question-4-u-problem-in-extracting-tar-and-tar-gz-files-367903/)

p_garg 09-28-2005 02:47 PM

a tough question 4 u, problem in extracting tar & tar.gz files
 
halo friends,

when i am extracting tar.gz files with command tar xvzf, i am getting a message in every file, cannot change file ownership to uid uid no., cannot change file ownership to gid gidno., & one more thing is showing in that, file ownership of this tar file is 0755, when i am trying to change file ownership with chmod to 0777, it is not permiting me to do this. i think problem is with file permissions. this problem is not with a single package, a lot of package i am trying to extract, all having same problem. neither its a problem of linux vesion, bcaz 1st i am getting this problem in version 4, then i installed version 3, but same problem i get there also. plz tell me what to do.

tomj88 09-28-2005 03:36 PM

Maybe you need to extract the file as root? or add the p option to the tar command to preserve permissions, so tar xzpvf .tar.gz or tar xjpvf .tar.bz2

p_garg 09-28-2005 03:40 PM

Quote:

Originally posted by tomj88
Maybe you need to extract the file as root? or add the p option to the tar command to preserve permissions, so tar xzpvf .tar.gz or tar xjpvf .tar.bz2

no even after trying xzpvf option for that , the result is same.

teto 04-04-2006 01:15 PM

try extracting without the "z" opion , only the "xvf" is enough

ntubski 04-04-2006 01:46 PM

What are the permissions of the directory the .tar.gz is located in? Go to it's parent directory, and run ls -ld directoryname to find out.

As for the z option, you need it if you're trying to extract a .tar.gz file, for a .tar file xf is enough. So you could first run gunzip on a .tar.gz file to get a .tar file then run tar with xf. The v is never needed, it stands for verbose, causes the names of the files to be outputed when you run tar.

ozled 11-08-2010 11:02 AM

Belated answer
 
I know it has been a long time, but this thread appears at the top of the Google search so this may help someone.

When extracting with tar, the default for the root user is that tar attempts to retain the owner:group of the files originally stored in the tar.
When transferring tar files across systems, this may cause problem if the same user does not exist in the target machine.
Using the option --no-same-owner will force tar to extract the files and assign them root as owner.
The error does not appear when extracting with a normal user because in that case the default option is --no-same-owner.


All times are GMT -5. The time now is 09:41 AM.