LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-28-2005, 03:47 PM   #1
LQ Newbie
Registered: Sep 2005
Location: delhi
Posts: 11

Rep: Reputation: 0
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.
Old 09-28-2005, 04:36 PM   #2
Registered: Apr 2005
Location: Wolverhampton, England
Distribution: Ubuntu
Posts: 334

Rep: Reputation: 30
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
Old 09-28-2005, 04:40 PM   #3
LQ Newbie
Registered: Sep 2005
Location: delhi
Posts: 11

Original Poster
Rep: Reputation: 0
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.
Old 04-04-2006, 02:15 PM   #4
LQ Newbie
Registered: Oct 2005
Distribution: Fedora Core
Posts: 6

Rep: Reputation: 0
try extracting without the "z" opion , only the "xvf" is enough
Old 04-04-2006, 02:46 PM   #5
Senior Member
Registered: Nov 2005
Distribution: Debian
Posts: 2,818

Rep: Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999
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.
Old 11-08-2010, 12:02 PM   #6
LQ Newbie
Registered: Apr 2006
Location: France
Distribution: FC4, Suse 10
Posts: 6

Rep: Reputation: 1
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting multiple files with tar -xjvf logicalfuzz Linux - Software 3 11-06-2005 02:21 AM
geting problem in extracting tar files p_garg Linux - Enterprise 1 09-29-2005 03:53 PM
hey geting problem in extracting tar files in version 4 p_garg Linux - Networking 1 09-29-2005 03:48 PM
extracting tar.bz2.gz files crank Linux - Newbie 5 04-19-2004 12:33 AM
Question on extracting a tar.gz VampiricuS Linux - Newbie 4 10-22-2003 10:47 AM

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration