Sub topic 2
Repositories, EPEL, and third-party software
This chapter assumes you can use sudo, install packages with apt or dnf, and check service status with systemctl. It also assumes you know what a firewall and mandatory access control do.
Repositories and their contents
A repository is a server that hosts packages and their metadata. Each distribution splits its packages into groups. Ubuntu uses main, universe, restricted, and multiverse. Debian uses main, contrib, and non-free. Rocky Linux uses BaseOS and AppStream, plus CRB (CodeReady Builder) for build dependencies.
Check which repositories a host uses:
# Debian and Ubuntu
apt-cache policy nginx
# Rocky Linux
dnf repolistEPEL on Rocky Linux
EPEL (Extra Packages for Enterprise Linux) is a community repository for RHEL-compatible systems. Enable it with:
sudo dnf install epel-release
sudo dnf config-manager --set-enabled crb
dnf repolist> Hmm, do not add quotes here.
:::
AppArmor and SELinux defaults
Ubuntu enables AppArmor by default. Rocky Linux runs SELinux in enforcing mode. Debian loads AppArmor in the kernel, but SELinux is not enabled. Check the active system:
getenforce
sudo aa-statusWhen SELinux blocks a service, do not disable it with setenforce 0. Find the denial and fix the file label or policy instead:
sudo ausearch -m avc -ts recentFirewall and network tooling differences
Ubuntu installs ufw but leaves it disabled. Rocky Linux runs firewalld by default. Debian has no default front end, so you add one, such as ufw or nftables directly.
# Ubuntu (ufw)
sudo ufw allow 22/tcp
sudo ufw enable
# Rocky Linux (firewalld)
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reloadNetwork configuration also differs. Ubuntu uses netplan YAML files in /etc/netplan/, applied with sudo netplan apply. Rocky Linux uses NetworkManager, managed with nmcli.
Installers and out-of-the-box defaults
Each distribution uses a different installer and automation format. Ubuntu Server uses Subiquity with autoinstall YAML. Debian uses debian-installer with preseed files. Rocky Linux uses Anaconda with Kickstart files. An automation file written for one installer does not work with the others.
Exercise
On a Rocky Linux server, which command shows whether SELinux is enforcing?
Show answer
getenforce