Version 2 (modified by james, 9 years ago)
change my to yb, for consistency

Search for packages, using just the package names and summaries.

yb = yum.YumBase()
yb.conf.cache = 1

searchterms = sys.argv[1:]

# Can be any of name/description/url/summary/etc.
searchlist = ['name', 'summary']

print '%s Searching %s' % tuple(['-' * 30] * 2)
res = yb.searchGenerator(searchlist, searchterms)

res = sorted(res, key=lambda x: x[0])

seen = set()
for (pkg, values) in res:
    if pkg.name not in seen:
        # Print name/summary
        print "%s : %s" % (pkg.name, pkg.summary)
        seen.add(pkg.name)