CertGrid CertGrid
Hands-on Lab·CompTIA Linux+

Linux+ lab: Ubuntu and AlmaLinux package families

XK0-006 is family-neutral, so a question may name apt or dnf, ufw or firewalld, AppArmor or SELinux. This guide introduces one machine of each kind and asks both the same four questions, so the pairs are learned together rather than twice.

Start Here Guide 2 of 28 Beginner

Ubuntu 26.04 LTS and AlmaLinux 10.2. Both are current at the time of writing. The Ubuntu host's login shell is zsh, which matters exactly once - and this page is where it comes up.

Both package families, because XK0-006 does not tell you which one you will get. The hostnames are provisioning artefacts shared with the other Linux paths; the OS column is what matters.
Server NameIP AddressOSRolesCPURAMHDD
LPLUS-A01192.168.0.73Ubuntu 26.04 LTSDebian-family host - apt, ufw, netplan, AppArmor2 Core4 GB50 GB
LPLUS-B01192.168.0.74AlmaLinux 10.2RPM-family host - dnf, firewalld, NetworkManager, SELinux2 Core4 GB50 GB

This guide includes

Use this before the hands-on guides. This matters because a question may name apt or dnf, ufw or firewalld - four tools differ between the families, and either may be the one asked about.

Before you start

  1. The two machines

    One of each family. Everything on this path runs on one or both.

    bash Example session
    . /etc/os-release; echo "$PRETTY_NAME"; uname -r; hostnamectl | head -3Ubuntu 26.04 LTS7.0.0-30-generic  Static hostname: lplus-a01        Icon name: computer-vm          Chassis: vm 🖴. /etc/os-release; echo "$PRETTY_NAME"; uname -r; hostnamectl | head -3AlmaLinux 10.2 (Lavender Lion)6.12.0-211.7.3.el10_2.x86_64     Static hostname: lplus-b01           Icon name: computer-vm             Chassis: vm 🖴

    Expected resultUbuntu 26.04 LTS on kernel 7.0.0-30-generic; AlmaLinux 10.2 on 6.12.0-211.7.3.el10_2.x86_64.

    Success conditionYou know which machine is which.

  2. The four tools that differ

    Package manager, firewall, access control, shell. Ask each host what it has.

    bash Example session
    printf '%-14s %s\n' shell "$BASH_VERSION" pkg "$(command -v apt-get dpkg | tr '\n' ' ')" fw "$(command -v ufw | tr '\n' ' ')" mac "$(command -v aa-status apparmor_status 2>/dev/null | head -1)"shellpkg            /usr/bin/apt-get /usr/bin/dpkgfw             /usr/sbin/ufwmac            /usr/sbin/aa-statusprintf '%-14s %s\n' shell "$BASH_VERSION" pkg "$(command -v dnf rpm | tr '\n' ' ')" fw "$(command -v firewall-cmd | tr '\n' ' ')" mac "$(command -v getenforce | tr '\n' ' ')"shellpkg            /usr/bin/dnf /usr/bin/rpmfw             /usr/bin/firewall-cmdmac            /usr/sbin/getenforce

    Expected resultUbuntu: apt-get/dpkg, ufw, aa-status - and shell is blank. RHEL: dnf/rpm, firewall-cmd, getenforce, shell 5.2.26.

    Success conditionYou can identify a machine's family from its tooling in one command.

  3. The same question, two answers

    Which package owns a file - the most useful query in Domain 1.

    bash Example session
    echo "which package owns /usr/bin/ssh?"; dpkg -S /usr/bin/sshwhich package owns /usr/bin/ssh?openssh-client: /usr/bin/sshecho "which package owns /usr/bin/ssh?"; rpm -qf /usr/bin/sshwhich package owns /usr/bin/ssh?openssh-clients-9.9p1-23.el10_2.alma.1.x86_64

    Expected resultopenssh-client: /usr/bin/ssh on Ubuntu; openssh-clients-9.9p1-7.el10_0.x86_64 on RHEL.

    Success conditionYou can go from a file to its package on either family.

  4. Access control and firewall, as found

    Both machines have a mandatory access control layer and a firewall. Neither pair is configured the same.

    bash Example session
    echo "is the mandatory access control layer on?"; aa-status --enabled 2>/dev/null && echo "AppArmor: enabled" || sudo aa-status 2>&1 | head -2is the mandatory access control layer on?sudo: aa-status: command not foundecho "is the mandatory access control layer on?"; getenforce; sestatus 2>/dev/null | head -3is the mandatory access control layer on?EnforcingSELinux status:                 enabledSELinuxfs mount:                /sys/fs/selinuxSELinux root directory:         /etc/selinuxecho "what is the firewall doing?"; sudo ufw status | head -2what is the firewall doing?sudo: ufw: command not foundecho "what is the firewall doing?"; sudo firewall-cmd --state; sudo firewall-cmd --get-default-zonewhat is the firewall doing?runningpublic

    Expected resultAppArmor: enabled on Ubuntu; Enforcing and SELinux status: enabled on RHEL. Firewall: Status: inactive on Ubuntu, running in zone public on RHEL.

    Success conditionYou know the default posture of each family.

Troubleshooting

Official sources