Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Forgotten how I did this last time. Tried the following 2 methods that I thought had worked for me in the past:

method #1

$ wget \

method #2

$ wget --no-cookies \
    --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \
    "yourversion.rpm" \
    -O /opt/jdk-7u51-linux-i586.rpm --no-check-certificate

But neither worked. For the time being I'll just download it the old fashion way but I'd like to be able to download it using wget as well.

share|improve this question
IMHO You should write an Answer, instead of putting the answer in the Question. How are readers going to know that this is resolved without reading through the whole question as there is no answer marked Accepted? – Timo Jan 23 '14 at 6:17
I don't know, I have been too busy trying to work stuff out all day to give it any thought sorry. – cea Jan 23 '14 at 8:01
up vote 2 down vote accepted

This worked for me:

$ wget --no-check-certificate                              \
    --no-cookies                                           \
    --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \

If you truly want to dump this file to /opt/jdk... then you'll need to be root to write to that location. Just prefix the above command with sudo, and specify the output location, -O "/opt/jdk-7-linux-i586.rpm".

$ sudo wget ... -O "/opt/jdk-7u51-linux-i586.rpm"

Here's the full command:

$ sudo wget --no-check-certificate                         \
--no-cookies                                               \
--header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com"     \
-O "/opt/jdk-7u51-linux-i586.rpm"                          \


share|improve this answer
the above doesn't work though. – cea Jan 23 '14 at 8:02
@CharlieBunt - strange, I ran that exact command and it did work for me. Did you get any kind of error message when you ran it? – slm Jan 23 '14 at 13:33
yes I did get an error message but I can't remember what it was now. I tried it several times and it seemed to be going through but failed and it was big file so I just found it safer in the end to download from source straight to desktop. – cea Jan 24 '14 at 0:34
@CharlieBunt - I'd be curious to see the error msgs. The above worked/works for me so something else must be going on. – slm Jan 24 '14 at 9:11
I promise to recreate the error if you can add to this unix.stackexchange.com/questions/110693/… – cea Jan 24 '14 at 11:16

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.