Main Menu

Search

LINUX: Command To Find RPM Version And Its Architecture? ("rpm command")

Below command can be used for finding the rpm package version and its architecture.

rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n' | grep -i <rpm name>


Below example output of above command. As seen below command shows httpd rpm version and its architecture.


#rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n' | grep -i httpd
httpd-tools-2.2.15-60.0.1.el6_9.5 x86_64
httpd-manual-2.2.15-60.0.1.el6_9.5 noarch
httpd-2.2.15-60.0.1.el6_9.5 x86_64

Alternatively below command can also be used for better formatting of the output.


rpm -q <rpm name> --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n'

Below is example output of above command.

# rpm -q httpd --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n'
httpd-2.2.15-60.0.1.el6_9.5 (x86_64)

Products to which Article Applies

All Linux Environments

Additional References


https://rpm.org/user_doc/query_format.html



 


tarun boyella

No comments:

Post a Comment