[Yum] Install packages into rootfs using python API - fails during key installing
Peter Lemenkov
lemenkov at gmail.com
Fri Jul 19 10:38:22 UTC 2013
Hello All!
I'm facing the following issue. I've got a valid rootfs skeleton which
I'm populating with the following command w/o an errors:
* yum install -y --releasever=6
--installroot=/vmroot/test/rootfs_testrootfs openssh-server plymouth
rsyslog acpid ntp epel-release
Now I'm trying to do the same with pure python API:
=================
#!/usr/bin/python
import yum
yb = yum.YumBase()
yb.conf.installroot = "/vmroot/test/rootfs_testrootfs"
yb.conf.yumvar['releasever'] = '6'
for i in ("openssh-server", "plymouth", "rsyslog", "acpid", "ntp",
"epel-release"):
yb.install(name=i)
yb.resolveDeps()
yb.buildTransaction()
yb.processTransaction()
=================
And I suddenly got the following issue:
=================
[root at virttest vmroot]# python testd.py
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos-mirror.rbc.ru
* epel: fedora-mirror01.rbc.ru
* extras: centos-mirror.rbc.ru
* updates: mirror.logol.ru
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid: "CentOS-6 Key (CentOS 6 Official Signing Key)
<centos-6-key at centos.org>"
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Traceback (most recent call last):
File "testd.py", line 11, in <module>
yb.processTransaction()
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 4989,
in processTransaction
self._checkSignatures(pkgs,callback)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 5032,
in _checkSignatures
self.getKeyForPackage(po, self._askForGPGKeyImport)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 4754,
in getKeyForPackage
raise Errors.YumBaseError, _("Didn't install any keys")
yum.Errors.YumBaseError: Didn't install any keys
[root at virttest vmroot]#
=================
I found this unanswered question at stackoverflow and that's all:
* http://stackoverflow.com/questions/13224166/installing-pgp-key-for-yum-repos-through-python-api
Could somebody help me since I'm not a well-familiar with yum
internals - what did I miss? Interestingly but setting
"yb.conf.gpgcheck = False" doesn't make any difference at all. It
still fails with the stacktrace above.
--
With best regards, Peter Lemenkov.
More information about the Yum
mailing list