Description of problem: Trying to initiate buildroot for RHEL7 with boostrap root enabled, the --init command fails: ~~~ $ rpm -q yum package yum is not installed $ mock -r rhel-7-x86_64 --init INFO: mock.py version 1.4.2 starting (python version = 3.6.1)... Start(bootstrap): init plugins INFO: selinux disabled Finish(bootstrap): init plugins Start: init plugins INFO: selinux disabled Finish: init plugins Start: run Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init INFO: LVM plugin enabled. Allocated pool data: 12.52%. Allocated metadata: 7.25%. WARNING: For multilib systems, both architectures of nosync library need to be installed INFO: calling preinit hooks INFO: enabled yum cache Start(bootstrap): cleaning yum metadata Finish(bootstrap): cleaning yum metadata INFO: enabled HW Info plugin Mock Version: 1.4.2 INFO: Mock Version: 1.4.2 Start(bootstrap): yum install Error: There are no enabled repos. ERROR: Command failed: # /usr/bin/yum --installroot /var/lib/mock/rhel-7-x86_64-bootstrap/root/ --releasever 7 install yum yum-utils shadow-utils distribution-gpg-keys Error: There are no enabled repos. ~~~ If I had yum installed it would pass: ~~~ $ rpm -q yum yum-3.4.3-512.fc26.noarch $ mock -r rhel-7-x86_64 --init INFO: mock.py version 1.4.2 starting (python version = 3.6.1)... Start(bootstrap): init plugins INFO: selinux disabled Finish(bootstrap): init plugins Start: init plugins INFO: selinux disabled Finish: init plugins Start: run Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init INFO: LVM plugin enabled. Allocated pool data: 12.52%. Allocated metadata: 7.25%. WARNING: For multilib systems, both architectures of nosync library need to be installed INFO: calling preinit hooks INFO: enabled yum cache Start(bootstrap): cleaning yum metadata Finish(bootstrap): cleaning yum metadata INFO: enabled HW Info plugin Mock Version: 1.4.2 INFO: Mock Version: 1.4.2 Start(bootstrap): yum install Yum command has been deprecated, use dnf instead. See 'man dnf' and 'man yum2dnf' for more information. =============================================================================== Package Arch Version Repository Size =============================================================================== Installing: shadow-utils x86_64 2:4.1.5.1-24.el7 rhel7 1.1 M yum noarch 3.4.3-154.el7 rhel7 1.2 M yum-utils noarch 1.1.31-42.el7 rhel7 116 k ... snip ... ~~~ BTW I don't understand why mock is trying to use YUM at all. 1) dnf/yum are the same when DNF is installed and YUM is not. 2) I'd expect, that the boostrap root should avoid the need to have YUM installed on my system. Version-Release number of selected component (if applicable): $ rpm -q mock mock-1.4.2-1.fc27.noarch How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: ~~~ $ rpm -q yum package yum is not installed $ mock -r rhel-7-x86_64 --init INFO: mock.py version 1.4.2 starting (python version = 3.6.1)... Start(bootstrap): init plugins INFO: selinux disabled Finish(bootstrap): init plugins Start: init plugins INFO: selinux disabled Finish: init plugins Start: run Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init INFO: LVM plugin enabled. Allocated pool data: 12.52%. Allocated metadata: 7.25%. WARNING: For multilib systems, both architectures of nosync library need to be installed INFO: calling preinit hooks INFO: enabled yum cache Start(bootstrap): cleaning yum metadata Finish(bootstrap): cleaning yum metadata INFO: enabled HW Info plugin Mock Version: 1.4.2 INFO: Mock Version: 1.4.2 Start(bootstrap): yum install Error: There are no enabled repos. ERROR: Command failed: # /usr/bin/yum --installroot /var/lib/mock/rhel-7-x86_64-bootstrap/root/ --releasever 7 install yum yum-utils shadow-utils distribution-gpg-keys Error: There are no enabled repos. ~~~ Expected results: ~~~ $ rpm -q yum package yum is not installed $ mock -r rhel-7-x86_64 --init ~~~ This should work IMO. Additional info: Actually, I don't understand why the "Error: There are no enabled repos." is issued. Are the configurations for DNF/YUM stored on different place? DNF should be always able to consume YUM configurations and as far as I remember, the move of configurations to DNF directories was rejected on Fedora.
I am getting little bit different TB $ mock -r epel-7-x86_64 --bootstrap-chroot --init INFO: mock.py version 1.4.1 starting (python version = 3.6.1)... Start(bootstrap): init plugins INFO: selinux disabled Finish(bootstrap): init plugins ERROR: Command /usr/bin/yum-deprecated is not available. Either install package containing this command or run mock with --yum or --dnf to overwrite config value. However this may lead to different dependency solving! Traceback (most recent call last): File "/usr/libexec/mock/mock", line 934, in <module> main() File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/libexec/mock/mock", line 703, in main buildroot = Buildroot(config_opts, uidManager, state, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/lib/python3.6/site-packages/mockbuild/buildroot.py", line 62, in __init__ self.pkg_manager = package_manager(config, self, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 21, in package_manager return Yum(config_opts, chroot, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 191, in __init__ self._check_command() File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 171, in _check_command lead to different dependency solving!""".format(self.command)) Exception: Command /usr/bin/yum-deprecated is not available. Either install package containing this command or run mock with --yum or --dnf to overwrite config value. However this may lead to different dependency solving!
(In reply to Miroslav Suchý from comment #1) Heh, funny enough: ~~~ $ sudo dnf remove dnf-yum $ mock -r rhel-7-x86_64 --init INFO: mock.py version 1.4.2 starting (python version = 3.6.1)... ERROR: Command /usr/bin/yum is not available. Either install package containing this command or run mock with --yum or --dnf to overwrite config value. However this may lead to different dependency solving! Traceback (most recent call last): File "/usr/libexec/mock/mock", line 934, in <module> main() File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/libexec/mock/mock", line 698, in main is_bootstrap=True) File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/lib/python3.6/site-packages/mockbuild/buildroot.py", line 62, in __init__ self.pkg_manager = package_manager(config, self, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 21, in package_manager return Yum(config_opts, chroot, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 191, in __init__ self._check_command() File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 171, in _check_command lead to different dependency solving!""".format(self.command)) Exception: Command /usr/bin/yum is not available. Either install package containing this command or run mock with --yum or --dnf to overwrite config value. However this may lead to different dependency solving! ~~~ This is quite close to your TB, but it requires "yum" instead of "yum-deprecated".
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
I have this problem too. My EPEL 7 mock builds started working after I installed dnf-utils. Dnf-utils provides /usr/bin/yum-builddep (implemented using the dnf python api). I therefore think that mock is missing a dependency on dnf-utils. My EPEL 6 mock builds started working after applying the following change: # diff -ur /usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py.orig /usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py --- /usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py.orig 2017-08-22 16:14:27.000000000 +0200 +++ /usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py 2017-08-28 17:31:55.280046012 +0200 @@ -114,6 +114,6 @@ supported = hasattr(cli.YumBaseCli, "_parseSetOpts") sys.path.pop(0) return supported - except SyntaxError: + except (SyntaxError, ModuleNotFoundError): # We're on python 3, assuming yum is new enough return True
Same issue. Fixed the same ways as Mattias (comment above). 1. install dnf-utils 2. patch /usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py
I believe this is fixed in mock-1.4.9-1. Can you confirm?
pretty much the same: [root@root ~]# mock -r rhel-7-x86_64 --init INFO: mock.py version 1.4.9 starting (python version = 3.6.4)... ERROR: Command /usr/bin/yum is not available. Either install package containing this command or run mock with --yum or --dnf to overwrite config value. However this may lead to different dependency solving! Traceback (most recent call last): File "/usr/libexec/mock/mock", line 959, in <module> main() File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/libexec/mock/mock", line 723, in main buildroot = Buildroot(config_opts, uidManager, state, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/lib/python3.6/site-packages/mockbuild/buildroot.py", line 62, in __init__ self.pkg_manager = package_manager(config, self, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 21, in package_manager return Yum(config_opts, buildroot, plugins, bootstrap_buildroot) File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 200, in __init__ self._check_command() File "/usr/lib/python3.6/site-packages/mockbuild/package_manager.py", line 178, in _check_command lead to different dependency solving!""".format(self.command)) Exception: Command /usr/bin/yum is not available. Either install package containing this command or run mock with --yum or --dnf to overwrite config value. However this may lead to different dependency solving! [root@root ~]# rpm -q mock mock-1.4.9-1.fc27.noarch
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This still not resolved, if I am not mistaken.
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle. Changing version to '30.
This should be fixed as of 334f092fa0bfe5b60e506eb77e0f0feff1cc931a At least the code which tries to import yum is gone and so is the try/except part.