AlmaLinux 9: 7 checks after a fresh install
Test scope
Section titled “Test scope”Executed in an almalinux:9 container (AlmaLinux 9.8, aarch64): cat /etc/almalinux-release, dnf repolist --enabled, ls -l /etc/localtime, cat /etc/hostname, firewall-offline-cmd after installing firewalld, and needs-restarting -r after installing yum-utils. Log: plans/content-expansion/evidence/logs/alma-first-steps.log.
timedatectl, getenforce and hostnamectl need systemd or live SELinux, which the container lacks, so they are not tested here.
1. Release and default repositories
Section titled “1. Release and default repositories”cat /etc/almalinux-releasednf repolist --enabledAlmaLinux release 9.8 (Olive Jaguar)repo id repo nameappstream AlmaLinux 9 - AppStreambaseos AlmaLinux 9 - BaseOSextras AlmaLinux 9 - ExtrasOnly these three are enabled; CRB is off. Enable it per command with --enablerepo=crb when you need glibc-static or *-devel.
2. Timezone and time sync
Section titled “2. Timezone and time sync”ls -l /etc/localtimelrwxrwxrwx ... /etc/localtime -> ../usr/share/zoneinfo/UTCThe container defaults to UTC. On a real system use timedatectl set-timezone Asia/Shanghai and confirm systemctl status chronyd is active (needs a real system).
3. Hostname
Section titled “3. Hostname”cat /etc/hostnameIn the container this is the random container ID; on a real system use hostnamectl set-hostname app01.example.com and check hostname -f returns the FQDN (needs a real system).
4. SELinux
Section titled “4. SELinux”getenforcesestatus | head -5Needs a real system: the container has no live SELinux. A fresh AlmaLinux 9 install is enforcing; debug with
ausearch -m avcandsealert, never hide problems withsetenforce 0.
5. Firewall defaults
Section titled “5. Firewall defaults”firewall-offline-cmd --get-default-zonefirewall-offline-cmd --zone=public --list-servicespubliccockpit dhcpv6-client sshThe default zone is public and only cockpit, dhcpv6-client and ssh are allowed. Remember to open ports for new services: /en/firewalld-zones/.
6. Updates and reboot needs
Section titled “6. Updates and reboot needs”sudo dnf -y install yum-utilssudo dnf -y updatesudo needs-restarting -rNo core libraries or services have been updated since boot-up.Reboot should not be necessary.Exit code 0 means no reboot is needed, 1 means one is. The command comes from yum-utils, not dnf-plugins-core.
7. Minimal-install package baseline
Section titled “7. Minimal-install package baseline”dnf list installed | wc -lrpm -q firewalld chronyNeeds a real system: the container is a stripped rootfs whose package count is not comparable. A real minimal install is usually 400–600 packages and does not always include
firewalldandchrony; check withrpm -q, thendnf install -y firewalld chronyandsystemctl enable --now.
Practice: a 10-minute check
Section titled “Practice: a 10-minute check”On a fresh AlmaLinux 9 host, run each item and record the result:
dnf repolist --enabled→ exactly baseos/appstream/extrastimedatectl status | grep "Time zone"→ the zone you expecthostname -f→ an FQDNgetenforce→Enforcingfirewall-cmd --zone=public --list-services→ only the three defaultsneeds-restarting -r; echo $?→0rpm -q firewalld chrony→ both print versions
常见问题
Why is crb missing from `dnf repolist`?
CRB is disabled by default. Enable it per command with `--enablerepo=crb`, or permanently in the repo file when needed; keeping it off by default avoids mixing package sources.
Is `getenforce` showing Disabled normal in a container?
Yes. The container has no live SELinux, so the result says nothing about a real host. A fresh AlmaLinux 9 install is enforcing — verify on the host.
`needs-restarting` says a reboot is needed — can I just reboot?
First check whether it reports a kernel or core library update, confirm the maintenance window and health checks, then reboot; when unsure, `dnf history list` shows what that update installed.
Next steps
Section titled “Next steps”- Opening ports: firewall-cmd rules
- Transaction rollback: dnf history undo
- Offline installs: Offline package installs