[Yum] Using yum within a program

Teresa Thomas tthomas at redhat.com
Wed Jul 11 20:31:57 UTC 2007


Hi, 

I am relatively new to programming on POSIX and would like some advice on using yum within a program. 

When a certain event happens in my program (written in JAVA), I want to install a package onto the system. I was looking into java.lang.Runtime's exec() function which can be used to execute command(s) as a separate process. But this becomes tricky in some cases. For example, when the user is not logged in as root, yum requires authentication and this involves using buffered readers for command outputs and inputs.

Is there a better way of doing this? Maybe some arguments/options with yum that will decrease the need for user interference? Or use of some scripting languages?

The project I am working on has both command line and GUI components, so a solution compatible/extensible with both would be the best. Thanks in advance for any help.

Cheers,

Teresa







More information about the Yum mailing list