Re: root rpm package list?

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

 



On Wed, 3 Nov 2010 20:58:05 -0400
Tom Horsley wrote:

> deplist is looking the most promising so far.

It isn't fast, but it seems to work. I whipped out a
little "find-roots" perl script to do the job:

#!/usr/bin/perl -w
#
# Long running script to find all the deps of all the packages
# then find all the installed rpms that are not deps of anything.
#
use strict;

my %rpms;
my $fh;

# This is the bit that takes forever to run, and it also (apparently)
# describes every package in every repo that might provide a dependency,
# so the list this generates is about 10 times larger than the actual
# installed base.

open($fh, '-|', 'yum', 'deplist', '*');
while (<$fh>) {
   if (/^\s*provider:\s*(\S+)\s*\S+\s*$/) {
      $rpms{$1} = 1;
   }
}
close($fh);
undef($fh);

# Getting the list of actual installed rpms is much less time consuming.

my %installed;
open($fh, '-|', 'rpm', '-q', '--qf', '%{NAME}.%{ARCH}\n', '-a');
while (<$fh>) {
   chomp;
   $installed{$_} = 1;
}
close($fh);
undef($fh);

# Now we print all the rpms that are installed, but which do not show
# up as a provider of any dependency.

foreach $_ (sort(keys(%installed))) {
   if (! exists($rpms{$_})) {
      print "$_\n";
   }
}
-- 
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