Re: only critical packages in minimal installation

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

 



Patrick wrote:

Would you mind sharing that script. I can't seem to get access to that
url.

Sure thing, here it is.
#!/usr/bin/python

# Script taken from .. 
# https://www.redhat.com/mailman/private/rpm-list/2004-February/msg00155.html

import rpm

ts = rpm.TransactionSet()

req = {}
orphan = []

for h in ts.dbMatch('name'):
	name = h['name']
	if not h[rpm.RPMTAG_REQUIRENAME]:
		continue
	for r in h[rpm.RPMTAG_REQUIRENAME]:
		req[r] = name

for h in ts.dbMatch('name'):
	name = h['name']
	preq = 0
	for p in h[rpm.RPMTAG_PROVIDES] + h[rpm.RPMTAG_FILENAMES]:
		if req.has_key(p):
			preq = preq + 1

	if preq == 0:
		orphan.append(name)

orphan.sort()
for p in orphan:
	print p

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux