Re: looking for rpm/yum database utility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/04/2011 04:23 AM, suvayu ali wrote:
> On Fri, Jun 3, 2011 at 7:41 PM, Robert G. (Doc) Savage
> <dsavage@xxxxxxxxxxx> wrote:
>> Sam & JD,
>>
>> I must apologize for asking this question to the wrong list. I knew the
>> Fedora version does this. What I'm actually looking for is that same
>> repo info for a RHEL5 system with some additional packages sourced from
>> RHN, EPEL, CentOS, RPMFusion, ElRepo, Adobe, and some other cats & dogs.
>> The RHEL5 version of yum simply tells me "installed".
> 
> Maybe you could parse the output of rpm -qi and get something useful out of it?
> 

Why parse things when you can just ask for the information from RPM in the
format you'd like it?

The rpm command allows you to list the available query tags (fields) and then
construct custom query formats on the command line:

$ rpm --querytags | wc -l
183
$ rpm --querytags | head
ARCH
ARCHIVESIZE
BASENAMES
BUGURL
BUILDARCHS
BUILDHOST
BUILDTIME
C
CHANGELOGNAME
CHANGELOGTEXT

Anyway, in this case I don't think it'll help directly as the package
installation repo is not stored in the database (rpm doesn't know anything about
yum or repositories) but is retrieved from the yum metadata.

I think that yum-utils and repoquery are available for RHEL5 (in EPEL iirc) so
maybe you can do something with that.

Failing that if you just want to differentiate the list of vendors above you can
probably do this via the RPM Vendor tag instead. Doing this on my f15 box I see:

$ rpm -qa --queryformat "%{VENDOR}\n" | sort | uniq
Fedora Project
(none)
Red Hat, Inc.
RPM Fusion

Then you can break that out by vendor by adding in the name and grepping:

$ rpm -qa --queryformat "%{NAME} %{VENDOR}\n" | grep '(none)'
gpg-pubkey (none)
bibble5 (none)
chromium-libs (none)
kmod-nvidia-2.6.38.6-26.rc1.fc15.x86_64 (none)
gpg-pubkey (none)
kmod-nvidia-2.6.38.3-18.fc15.x86_64 (none)
gpg-pubkey (none)
v8 (none)
gpg-pubkey (none)
chromium (none)
kmod-nvidia-2.6.38.5-22.fc15.x86_64 (none)
gpg-pubkey (none)

Not ideal I know but it may still be useful enough - e.g. all those
"gpg-pubkey"s are a bit annoying - the summary field reveals more than the other
headers in that case:

$ rpm -q gpg-pubkey | xargs rpm -q --queryformat '%{SUMMARY}\n'
gpg(Fedora (15) <fedora@xxxxxxxxxxxxxxxxx>)
gpg(RPM Fusion nonfree repository for Fedora (14)
<rpmfusion-buildsys@xxxxxxxxxxxxxxxxxxx>)
gpg(RPM Fusion nonfree repository for Fedora (15)
<rpmfusion-buildsys@xxxxxxxxxxxxxxxxxxx>)
gpg(RPM Fusion free repository for Fedora (14)
<rpmfusion-buildsys@xxxxxxxxxxxxxxxxxxx>)
gpg(RPM Fusion free repository for Fedora (15)
<rpmfusion-buildsys@xxxxxxxxxxxxxxxxxxx>)

Regards,
Bryn.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux