Operating System - HP-UX
1828302 Members
3626 Online
109975 Solutions
New Discussion

how to detect if a patch is installed ?

 
SOLVED
Go to solution
T.J. Yang
Frequent Advisor

how to detect if a patch is installed ?

Is there a one line command to report if a patch is installed or not ?

Thanks for your pointer

tj
6 REPLIES 6
T.J. Yang
Frequent Advisor

Re: how to detect if a patch is installed ?

Looking at HP-UX FAQ, I an able to answer my own question.

bash-2.05a# /usr/sbin/swlist -l product 'PHCO_23702';echo $?
# Initializing...
# Contacting target "hp11v1"...
#
# Target: hp11v1:/
#

PHCO_23702 1.0 cumulative header file patch for prot.h
0
bash-2.05a# /usr/sbin/swlist -l product 'PHCO_23703';echo $?
# Initializing...
# Contacting target "hp11v1"...
ERROR: Software "PHCO_23703" was not found on host "hp11v1:/".
1
bash-2.05a#
Sameer_Nirmal
Honored Contributor
Solution

Re: how to detect if a patch is installed ?

Hi TJ,

Try following commands

# swlist -l patch
e.g. # swlist -l patch PHCO_23703

You can try another old command which will show you applied patches.
# show_patches -a | grep "PHCO_23703"
Arunvijai_4
Honored Contributor

Re: how to detect if a patch is installed ?

Hi Yang,

You can do the following,

If you are in 11.11, run the following command

# /usr/contrib/bin/show_patches | grep -i patch_name

# swlist -l product

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
T.J. Yang
Frequent Advisor

Re: how to detect if a patch is installed ?

Just want to say thanks for the quick multiple responses.

I am impressed by HP-UX forum's support quality.

tj
Siddhartha M
Frequent Advisor

Re: how to detect if a patch is installed ?

Hi TJ,

You can also invoke the following command to check if dependent/superceded patches for a particular patch ( "Patch Name" ) is installed or not:

/usr/sbin/swlist -l patch -a patch_state -a supersedes *.*,c=patch | grep "Patch Name"

-Siddhartha
Wang,MinJie
Super Advisor

Re: how to detect if a patch is installed ?

Hey tj
The following command is the solution:
swlist -l patch ""
That's OK