[Yum] Programmatic interface to yum configuration files?

Amos Shapira amos.shapira at gmail.com
Thu Jan 8 01:25:23 UTC 2009


Hello,

My environment: CentOS 5.2, rpmforge repo

Is there some scriptable way to manipulate the yum configuration files?

Examples of things I'd like to be able to do automatically (e.g. from
inside an automatic deployment process):

1. Add "priority=" (with different values) to each repository.
2. Add "check_obsoletes=1" to priorities plugin
3. Add proxy settings

So far I made-do with specific hacks of perl/sed (e.g. "sed -i~
'/^\[main\]/a proxy=http://10.10.1.65:3128' /etc/yum.conf") but as I'd
like to generalise the approach I think it would be better to have
something which really understands the config file.

Perl is my favourite tool. I realise the Yum is written or heavily
uses Python so I suppose I'll manage with python scripts which can be
controlled from perl.

Thanks,

--Amos


More information about the Yum mailing list