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

Simplest transaction you can have (yum 3.2.7 and above):

yb = yum.YumBase()
yb.install(name='somepackage')
yb.remove(name='someotherpackage')
yb.resolveDeps()
yb.processTransaction()