RHCSA 2.1: RPM repositories and packages
A repository with a wrong URL, serving and using a repository of your own, finding the package that provides a command, and undoing a removal from dnf's history.
Before you start
The lab has added a repository extras-mirror in
/etc/yum.repos.d/extras-mirror.repo that points at a wrong URL, so
dnf install fails until you deal with it in task 1. It installs
createrepo_c, and removes policycoreutils-python-utils if it's
installed.
The peer, at 10.99.0.2 (name peer), stands in for the second VM. It
shares this VM's files, so download the packages here (the peer has no
route to the internet) and serve them from the peer. Get a shell there
with sudo ip netns exec lepeer bash.
Tasks
- See what the wrong URL of
extras-mirrordoes todnf install, then disable that repository without deleting its file. - On the peer, serve a copy of a few packages over HTTP: download them
with
dnf downloadinto/srv/repo, runcreaterepo_con the directory, and startpython3 -m http.serverthere, bound to10.99.0.2. On this VM, configure that repository aslabin/etc/yum.repos.d/lab.repowith signature checking on, and install one of its packages from it withdnf install --repo lab. - Find and install the package that provides the
semanagecommand. - Remove a package you installed, then undo the removal from dnf's history.
Hints
dnf repolist --all;dnf config-manager --set-disabled, orenabled=0.- Pick packages that aren't installed yet, such as
tree. In the peer:createrepo_c /srv/repo, thenpython3 -m http.server 8000 --bind 10.99.0.2 --directory /srv/repo &. The repo file needsbaseurl=http://10.99.0.2:8000/,gpgcheck=1and agpgkey=from/etc/pki/rpm-gpg/.dnf repoinfo lab;dnf install --repo lab NAMEtakes it from that repository only. dnf provides semanage(or'*/semanage'). The firstdnf providesdownloads the file lists of every repository, which can take several minutes. It isn't hung.dnf history list,dnf history info,dnf history undo.