[Yum] Using yum within a program

seth vidal skvidal at linux.duke.edu
Thu Jul 12 03:15:03 UTC 2007


On Wed, 2007-07-11 at 16:31 -0400, Teresa Thomas wrote:
> Hi, 
> 
> 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.

yum isn't asking for the root pw - something else is doing this for yum.
Additionally, yum does allow for non-interactive processes - look at the
-y option.



> 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.

It might be a good idea to step back and figure out why you're trying to
do this and if there is a better way around it.

-sv





More information about the Yum mailing list