Hands-on tutorial
Package management on z/OS
Two short tracks, eight steps each. Work through them in a z/OS UNIX shell, copy each command, compare with the expected output, and tick the step off. Your progress is saved in this browser.
zopen publishes signed RPM packages that install under /opt/pkg and are tracked in a single RPM database. You manage them with dnf5 and rpm.
Before you start
You need a superuser (UID 0) shell and dnf5 configured for the zopen repository. If you haven't done that yet, follow the RPM setup guide first. See the RPM setup guide.
export PATH="/opt/pkg/bin:$PATH"
export LIBPATH="/opt/pkg/lib:$LIBPATH"
dnf5 --version- 1
Show the tooling
Confirm dnf5 and rpm are on your PATH and that the zopen repository is configured.
dnf5 --version rpm --version dnf5 repo list - 2
Browse the catalog
The zopen repository has about 150 packages: compilers, build tools, editors and Python libraries.
dnf5 list --available dnf5 search jq dnf5 info jq - 3
Install a package and use it
dnf5 downloads the package, checks its GPG signature and installs it under /opt/pkg.
dnf5 install jq command -v jq echo '{"platform":"z/OS"}' | jq .platformTip On your first install, dnf5 asks you to import the zopen signing key. Answer y.
- 4
Inspect it with rpm
Every installed file is recorded, so you can see what a package installed and which package owns a file.
rpm -qi jq rpm -ql jq rpm -qf /opt/pkg/bin/jq - 5
Check security and integrity
Packages are signed by the zopen key, and rpm -V checks installed files against the RPM database.
rpm -q gpg-pubkey rpm -V jq && echo "jq is unmodified"Tip rpm -V prints nothing when every file matches. Any changed file is listed with a code showing what changed.
- 6
See dependency resolution
dnf5 works out everything a package needs. git, for example, pulls in coreutils, perl, ncurses, less and libiconv.
dnf5 install git - 7
Review the audit trail
Every transaction records who made the change, when, the exact command, and RPM database fingerprints from before and after.
dnf5 history list dnf5 history info last - 8
Undo and roll back
Return the system to a known state without manual cleanup.
dnf5 history undo last rpm -q jqdnf5 install jq ripgrep dnf5 history list dnf5 history rollback <ID>
Clean up what this track installed, so you can run it again.
dnf5 remove jq ripgrep git