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]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux