First hour after install: 7 checks on Rocky 9 (with real output)
When to use it
Section titled “When to use it”Right after the install, before any workload, is the cheapest time to change configuration. Getting these 7 checks right saves pain later when you add services, open ports and debug. Container-tested output is shown as-is; anything needing systemd or a live SELinux is explicitly marked “run on a real system”.
1. Release and repositories
Section titled “1. Release and repositories”cat /etc/rocky-releasednf repolist --enabledRocky Linux release 9.3 (Blue Onyx)repo id repo nameappstream Rocky Linux 9 - AppStreambaseos Rocky Linux 9 - BaseOSextras Rocky Linux 9 - ExtrasOnly these three are enabled by default; CRB is not. When you need packages such as glibc-static or *-devel, enable it for that command with --enablerepo=crb instead of enabling it permanently.
2. Timezone and time sync
Section titled “2. Timezone and time sync”ls -l /etc/localtimetimedatectl statuslrwxrwxrwx. 1 root root 25 ... /etc/localtime -> ../usr/share/zoneinfo/UTCIn the container /etc/localtime points at UTC and timedatectl is unavailable (no systemd). On a real system run timedatectl set-timezone Asia/Shanghai and confirm systemctl status chronyd is active.
3. Hostname
Section titled “3. Hostname”cat /etc/hostnamehostnamectlIn the container /etc/hostname is the random container ID; on a real system use hostnamectl set-hostname app01.example.com and verify hostname -f returns the FQDN.
4. SELinux mode
Section titled “4. SELinux mode”getenforcesestatus | head -5Run on a real system: the container has no live SELinux, so
getenforcereturnsDisabledor the command is missing. A fresh Rocky 9 install is enforcing; do not hide problems withsetenforce 0— locate them withausearch/sealert.
5. Firewall
Section titled “5. Firewall”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 the port when you add a service: /en/firewalld-zones/.
6. Updates and reboot needs
Section titled “6. Updates and reboot needs”sudo dnf install -y yum-utilssudo dnf -y updatesudo needs-restarting -rNo core libraries or services have been updated since boot-up.Reboot should not be necessary.needs-restarting -r exits 0 when no reboot is needed and 1 when one is. It comes from yum-utils, not dnf-plugins-core.
7. Minimal versus DVD
Section titled “7. Minimal versus DVD”dnf list installed | wc -lrpm -q firewalld chronyRun on a real system: the container is a stripped rootfs, so its package count is not comparable to a minimal install. A real minimal install is usually around 400–600 packages and does not always include
firewalld/chrony; confirm withrpm -qand install withdnf install -y firewalld chronyplussystemctl enable --nowwhen missing.
Practice: a 10-minute checklist
Section titled “Practice: a 10-minute checklist”Run each item on a fresh Rocky 9 host and record the result:
dnf repolist --enabled→ exactly baseos/appstream/extras (CRB off)timedatectl status | grep "Time zone"→ the zone you expecthostname -f→ an FQDN (not localhost)getenforce→Enforcingfirewall-cmd --zone=public --list-services→ cockpit/dhcpv6-client/ssh onlyneeds-restarting -r; echo $?→0rpm -q firewalld chrony→ both print a version
Next steps
Section titled “Next steps”- Opening ports: firewall-cmd port rules
- Offline installs: Offline package installs
- Security baseline: Security baseline