14

I have downloaded 'jdk-7u55-linux-x64.tar.gz'

When I execute following command to extract,

 sudo tar xvzf jdk-7u55-linux-x64.tar.gz

also tried,

sudo tar xvf jdk-7u55-linux-x64.tar.gz
sudo tar xf jdk-7u55-linux-x64.tar.gz
sudo tar -xvf jdk-7u55-linux-x64.tar.gz

But am getting error at last as,

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

How to resolve this ?

17

Please don't use sudo unless necessary. If you are extracting this into a directory you have access to, there's no need for sudo.

Anyway, the error you're getting is usually due to an incomplete download. The archive ends before the expected footer of the gzipped file. It will probably work fine if you just download it again.

2
  • can you list me where are sudo required?
    – A J
    Jun 21 '14 at 4:01
  • 1
    @AJ when you get a "Permission denied" error. You should only use sudo for actions that your regular user cannot do because of permissions issues. Do not use it by default since that can cause all sorts of problems down the line.
    – terdon
    Jun 21 '14 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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