Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am not able to uncompress a file with .tar.gz extension

Did sudo tar -xvzf ~/Downloads/file.tar.gz /opt/ but no success. it says:

tar: /opt: Not found in archive
tar: Exiting with failure status due to previous errors
share|improve this question
    
I had a hard time on this one, go to: askubuntu.com/questions/148245/how-can-i-write-files-in-opt –  Alex Jan 18 '13 at 18:31
add comment

2 Answers 2

up vote 2 down vote accepted

You can specify in which directory you want the files extracted using the -C option. Change your command to:

sudo tar -xvzf ~/Downloads/file.tar.gz -C /opt/
share|improve this answer
add comment

Your are telling tar to look for /opt/ inside the tar file and to extract only that and since it is not in that tar file it throws an error. Do:

cd /opt
sudo cp  ~/Downloads/file.tar.gz .
sudo tar -xvzf file.tar.gz
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.