How to Download Oracle Patches From Oracle Support By Using WGET or CURL

1) Set up global variables :

export MOS_PASSWORD="Password"

export PROXYUSER="testuser"
export PROXYPASSWD="Password123"
export USERAGENT="Mozilla/5.0"
export use_proxy=on
export http_proxy=""
export https_proxy=""
export COOK=$HOME/$.cookie

2) The following command to authenticate uses HTTP/HTTPS:

$wget --proxy-user=${PROXYUSER} --proxy-password=${PROXYPASSWD} 
--http-user=${MOS_USER} --http-password=${MOS_PASSWORD} 
--save-cookies=$COOK --keep-session-cookies --no-check-certificate 
2018-02-26 14:35:17 URL: 
[118] -> "download.1" [1]

3) Get all supported platforms and language codes:

a) Output the query result into a temp file:

$wget --proxy-user=${PROXYUSER} --proxy-password=${PROXYPASSWD} 
--no-check-certificate --load-cookies=$COOK 
-O $HOME/output.tmp -q

$ ls -l $HOME/output.tmp
-rw-r----- 1 testuser users 4528477 Feb 26 14:41 /home/testuser/output.tmp

b) Extract the Platform and Language Code, here we are only interested in platform “226P<—>Linux x86-64″ with default English language:

$ grep -A200 "<select name=plat_lang"  /home/testuser/output.tmp |
 grep "^<option"|awk -F "[\">]" '{print $2 "<--->" $4}' |
 |grep -v "<--->selected"

537P<--->Acme Packet 1100
529P<--->Acme Packet 3820
541P<--->Linux ARM 64-bit
214P<--->Linux Itanium
525P<--->Linux SPARC
46P<--->Linux x86
226P<--->Linux x86-64
912P<--->Microsoft Windows (32-bit)
208P<--->Microsoft Windows Itanium (64-bit)
539P<--->Microsoft Windows Phone
233P<--->Microsoft Windows x64 (64-bit)
117L<--->Traditional Chinese (ZHT)
116L<--->Turkish (TR)
37L<--->UK English (GB)
39L<--->Ukrainian (UK)
43L<--->Vietnamese (VN)
999L<--->Worldwide Spanish (ESW)

4) Get URLs of patch 6880880 for Linux X86-64 platform.

$wget --proxy-user=${PROXYUSER} --proxy-password=${PROXYPASSWD} 
--no-check-certificate --load-cookies=$COOK 
=patch&patch_number=6880880&plat_lang=226P" -O $HOME/output1.tmp -q

$ ls -ltr $HOME/output1.tmp
-rw-r----- 1 tetsuser users 4544310 Feb 26 15:44 /home/testuser/output1.tmp

$ grep "Download/process_form" output1.tmp | sed 's/ //g' | sed "s/.*href=\"//g" | sed "s/\".*//g"

5) Download the patch by using URL from step 4):


$ curl -b $COOK -c $COOK --insecure --output 
-L ""

  % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 90.8M 100 90.8M 0 0 5008k 0 0:00:18 0:00:18 --:--:-- 20.7M


$ wget --load-cookies=$COOK --save-cookies=$COOK --keep-session-cookies 
--no-check-certificate -O 
Proxy request sent, awaiting response... 200 OK
Length: 95262503 (91M) [application/zip]
Saving to: `'

100%[=================================================================================================>] 95,262,503 21.9M/s in 16s

2018-02-26 17:57:20 (5.65 MB/s) - `' saved [95262503/95262503]

6) Validate the download zip file:

OPatch patch of version for Oracle software releases 12.1.0.x 
(installer) and 12.2.0.x (JAN 2018) (Patch)

p6880880_122010_Linux-x86-64.zip90.8 MB(95262503 bytes)

a) “unzip -t”

$ unzip -t
 testing: OPatch/ OK
 testing: OPatch/operr.bat OK
 testing: OPatch/ OK
No errors detected in compressed data of

b) MD5 “md5sum”

$ md5sum

c) SHA-1 “sha1sum”

$ sha1sum

d)SHA-256 “sha256sum”

$ sha256sum

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: