Question

I'm using Python 2.7. I have a .tar.gz file I create using the python tarfile library that unpacks into /opt. However when I try to unpack it using:

tar -xPzvf myfile.tar.gz

I get the following error:

tar: /: Cannot utime: Operation not permitted
tar: Exiting with failure status due to previous errors

It looks like the tar file is trying to modify the last modified time directly? I looked into the options tarfile provides but couldn't find anything relevant other than the actual modification time.

No correct solution

OTHER TIPS

You try to unpack to /opt directory, that you don't permission for that .

For example, if you want to create a file in /opt by normal user, you get this error:

$ touch  /opt/test
touch: cannot touch ‘/opt/test’: Permission denied

Try to unpack it to another directory, for example: /home/YOUR_USER/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top