Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I uninstalled xampp and tried to reinstall it but when trying to extract it to the /opt directory, I get the following error:

$ sudo tar -xzf -C /opt
tar (child): Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now.

Why does tar complaint that it cannot find the file while extracting the archive?

share|improve this question
did you inside the folder where tar.gz file is located? – Avinash Raj Feb 9 '14 at 16:32
Can you do ls -l in the dir where you run this command? – landroni Feb 9 '14 at 16:36
You change users (sudo) to a different person. That different person needs read rights on the tarball. Does that person (uid 0) have those rights? (The usual answer is: Heck yes, toor/root/admin has those rights, but but SE linux that is no longer always true. – Hennes Feb 9 '14 at 17:45

Most likely the dir in the terminal (identified by pwd) does not contain the archive that you're trying to unpack. You need to cd /path_to_archive_dir/, and then execute the command there (tar -xzf -C /opt).

share|improve this answer

Your Answer


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.