LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2015, 11:55 AM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,166
Blog Entries: 4

Rep: Reputation: 131Reputation: 131
rpm query format question


I'm trying to run rpm query format commands from the CLI, however I'm not able to get anything to return from them.

Here are two examples:

I believe this one looks for third party packages that doesn't come from Red Hat. However do I have to populate something where it says Name or Vendor?

Code:
rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v "Red Hat"
The other one is

Code:
rpm -qa --queryformat '%{name-%{version}-%{release} %{size}\n'
 
Old 07-06-2015, 12:39 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Distribution: SLES 12
Posts: 1,571

Rep: Reputation: 106Reputation: 106
https://refspecs.linuxbase.org/LSB_3...pkgformat.html
 
Old 07-08-2015, 08:30 PM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,166
Blog Entries: 4

Original Poster
Rep: Reputation: 131Reputation: 131
Followup.

I got the first query to work. It has to be ran on a RHEL server where there are third party RPMs installed

Code:
[user@server ~]$ rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v "Red Hat"
gpg-pubkey (none)
oracleasm-support Oracle Corporation
oracleasm-2.6.18-404.el5 Oracle Corporation
jdk1.8.0_25 Oracle Corporation
oracleasmlib Oracle Corporation
gpg-pubkey (none)
The other one, I was missing a } after name

Code:
rpm -qa --queryformat '%{name}-%{version}-%{release} %{size}\n'
 
  


Reply

Tags
query, red hat, rpm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which path to use to query rpm to determine which RPM to install? elitt2 Red Hat 4 10-08-2007 02:18 PM
rpm Query scbops Linux - General 1 08-01-2006 08:04 AM
how to query rpm on cd? binary_0011 Linux - Newbie 2 04-15-2006 10:34 AM
rpm query bong.mau Linux - General 2 11-05-2005 11:20 AM
rpm query lucky123 Linux - Newbie 1 04-21-2005 02:41 PM


All times are GMT -5. The time now is 06:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration