Reputation: 415
I am trying to get the Software Information from Red Hat. As far as I have tried,
rpm -qi <softwarename>
provides the enough information
from the above information, I do require Name, Version, Release, Vendor, Build Date, & Install Date.
I could able to get the Name Version Release & Install Date by using the following command.(here I have grepped only name and version for simplicity)
rpm -qi perl-Git | grep -E '^Name :|^Version :' | awk -F 'Relocations:|Vendor:' '{print $1}'
I have no clue to get the Right side of the Information, since I could not able to find a split string between two fields. Any suggestions ??
Upvotes: 0
Views: 129
Reputation: 6158
Use --queryformat
$ rpm -q --queryformat "%{NAME}\n%{VERSION}\n%{RELEASE}\n%{VENDOR}\n%{BUILDTIME}\n%{INSTALLTIME}\n" perl-Git
perl-Git
2.8.0
1.WANdisco.308
(none)
1459260423
1493311622
Then you can print it how you like, and parse it how you like.
Upvotes: 2