Chapter 13: Software management
Exercise: Software review
Set up software management on servera: your own repository with signature checking, a package installed from it, a version of nginx selected, and some routine installs and removals.
Software review
- Create a local repository and install from it with gpgcheck on.
- Enable a module stream.
- Install, remove and query packages.
Before you start: reset the servers and complete this chapter's lessons. You work on servera as root (sudo -i); lab start and lab grade run on workstation.
On servera:
- Build a repository in
/srv/localrepofromzipand its dependency (dnf download --resolve), withcreaterepo_c. - Define it in
/etc/yum.repos.d/local.repo(idlocalrepo,enabled=1,gpgcheck=1, with thegpgkeyyour system uses elsewhere) and installzipusing only that repository. - Install
wget, removetree, and enable thenginx:1.24module stream (without installing nginx). - On workstation, fill in
answers.txt.
Start the exercise
[student@workstation ~]$ lab start sa-software-review
[student@workstation ~]$ cd ~/sa-software-review
[student@workstation sa-software-review]$ ssh student@servera
[student@servera ~]$ sudo -i
[root@servera ~]#The repository and the install
[root@servera ~]# dnf install -y dnf-plugins-core createrepo_c
[root@servera ~]# mkdir -p /srv/localrepo
[root@servera ~]# dnf download --resolve --destdir /srv/localrepo zip
[root@servera ~]# createrepo_c /srv/localrepo
[root@servera ~]# key=$(grep -h '^gpgkey' /etc/yum.repos.d/*.repo | sort -u | head -1)
[root@servera ~]# cat > /etc/yum.repos.d/local.repo <<EOT
[localrepo]
name=Local repository
baseurl=file:///srv/localrepo
enabled=1
gpgcheck=1
$key
EOT
[root@servera ~]# dnf clean all > /dev/null
[root@servera ~]# dnf --disablerepo='*' --enablerepo=localrepo install -y zip
...output omitted...
Complete!The key= line copies the gpgkey= line used by your distribution's repositories, so the same command works on any of them.
Routine changes and the module
[root@servera ~]# dnf install -y wget
[root@servera ~]# dnf remove -y tree
[root@servera ~]# dnf module enable -y nginx:1.24
[root@servera ~]# cat /etc/dnf/modules.d/nginx.module
[nginx]
name=nginx
stream=1.24
profiles=
state=enabledFacts for answers.txt
[root@servera ~]# rpm -qf /usr/bin/passwd
passwd-0.80-12.el9.x86_64
[root@servera ~]# ls -d /etc/yum.repos.d
/etc/yum.repos.d
[root@servera ~]# exit
[student@servera ~]$ exitPASSWD_PACKAGE is passwd (the name only), CHECKSUM_FLAG is 5 (see the verification diagram in the first lesson), and REPO_DIR is /etc/yum.repos.d.
Grade
On workstation, with answers.txt filled in:
Check your work with lab grade sa-software-review, then put the exercise away with lab finish sa-software-review.