[Yum-devel] Equivalent to 'yum update' via Python API?

Seth Vidal skvidal at fedoraproject.org
Thu May 28 13:33:08 UTC 2009



On Thu, 28 May 2009, MacCana, Mike \(London\) wrote:

> Hi folks,
>  
> I was wondering what the equiavlent to a 'yum update' via the API was? I've read the various snippets and 5 minute guide,
> and have working functions to install individual apps, but I can't seem to locate the right functions in either the yum
> or cli modules.
>  

import yum
my = yum.YumBase()
my.update()
my.resolveDeps()
my.processTransaction()


update() is call you're looking for.

If nothing is passed to update() then it will attempt to update all pkgs 
on the system.

update(self, po=None, requiringPo=None, **kwargs)
     try to mark for update the item(s) specified.
     po is a package object - if that is there, mark it for update,
     if possible
     else use **kwargs to match the package needing update
     if nothing is specified at all then attempt to update everything

     returns the list of txmbr of the items it marked for update


does this help?

-sv



More information about the Yum-devel mailing list