How To Install mock on CentOS 8
Introduction
In this tutorial we learn how to install mock
on CentOS 8.
What is mock
Mock takes an SRPM and builds it in a chroot.
We can use yum
or dnf
to install mock
on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install mock.
Install mock on CentOS 8 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 kB 00:00
Metadata cache created.
After updating yum database, We can install mock
using dnf
by running the following command:
sudo dnf -y install mock
Install mock on CentOS 8 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 kB 00:00
Metadata cache created.
After updating yum database, We can install mock
using yum
by running the following command:
sudo yum -y install mock
How To Uninstall mock on CentOS 8
To uninstall only the mock
package we can use the following command:
sudo dnf remove mock
mock Package Contents on CentOS 8
/etc/mock/logging.ini
/etc/pam.d/mock
/etc/pki/mock
/etc/pki/mock/README.txt
/etc/security/console.apps/mock
/usr/bin/mock
/usr/bin/mock-parse-buildlog
/usr/bin/mockchain
/usr/lib/python3.6/site-packages/mockbuild
/usr/lib/python3.6/site-packages/mockbuild/__init__.py
/usr/lib/python3.6/site-packages/mockbuild/__pycache__
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/backend.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/backend.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/buildroot.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/buildroot.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/config.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/config.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/exception.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/exception.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/external.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/external.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/file_downloader.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/file_downloader.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/file_util.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/file_util.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/mounts.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/mounts.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/package_manager.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/package_manager.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/plugin.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/plugin.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/podman.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/podman.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/rebuild.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/rebuild.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/state.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/state.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/text.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/text.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/trace_decorator.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/trace_decorator.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/uid.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/uid.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/util.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/__pycache__/util.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/backend.py
/usr/lib/python3.6/site-packages/mockbuild/buildroot.py
/usr/lib/python3.6/site-packages/mockbuild/config.py
/usr/lib/python3.6/site-packages/mockbuild/exception.py
/usr/lib/python3.6/site-packages/mockbuild/external.py
/usr/lib/python3.6/site-packages/mockbuild/file_downloader.py
/usr/lib/python3.6/site-packages/mockbuild/file_util.py
/usr/lib/python3.6/site-packages/mockbuild/mounts.py
/usr/lib/python3.6/site-packages/mockbuild/package_manager.py
/usr/lib/python3.6/site-packages/mockbuild/plugin.py
/usr/lib/python3.6/site-packages/mockbuild/plugins
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/bind_mount.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/bind_mount.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/ccache.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/ccache.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/chroot_scan.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/chroot_scan.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/compress_logs.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/compress_logs.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/hw_info.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/hw_info.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/mount.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/mount.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/overlayfs.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/overlayfs.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/package_state.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/package_state.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/pm_request.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/pm_request.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/procenv.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/procenv.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/root_cache.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/root_cache.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/rpkg_preprocessor.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/rpkg_preprocessor.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/selinux.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/selinux.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/showrc.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/showrc.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/sign.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/sign.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/tmpfs.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/tmpfs.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/yum_cache.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/__pycache__/yum_cache.cpython-36.pyc
/usr/lib/python3.6/site-packages/mockbuild/plugins/bind_mount.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/ccache.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/chroot_scan.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/compress_logs.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/hw_info.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/mount.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/overlayfs.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/package_state.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/pm_request.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/procenv.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/root_cache.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/rpkg_preprocessor.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/selinux.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/showrc.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/sign.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/tmpfs.py
/usr/lib/python3.6/site-packages/mockbuild/plugins/yum_cache.py
/usr/lib/python3.6/site-packages/mockbuild/podman.py
/usr/lib/python3.6/site-packages/mockbuild/rebuild.py
/usr/lib/python3.6/site-packages/mockbuild/state.py
/usr/lib/python3.6/site-packages/mockbuild/text.py
/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py
/usr/lib/python3.6/site-packages/mockbuild/uid.py
/usr/lib/python3.6/site-packages/mockbuild/util.py
/usr/libexec/mock
/usr/libexec/mock/create_default_route_in_container.sh
/usr/libexec/mock/mock
/usr/share/bash-completion/completions/mock
/usr/share/bash-completion/completions/mock-parse-buildlog
/usr/share/cheat/mock
/usr/share/doc/mock/site-defaults.cfg
/usr/share/man/man1/mock-parse-buildlog.1.gz
/usr/share/man/man1/mock.1.gz
/var/cache/mock
/var/lib/mock
References
Summary
In this tutorial we learn how to install mock
on CentOS 8 using yum and dnf.