CertGrid CertGrid

Debian and Red Hat, side by side

LFCS is distribution-neutral and the exam may hand you either family. This is every place the two diverge, with the Ubuntu spelling beside the RHEL one - packages, services, firewall, networking and file systems.

Packages

  • apt-get install X ↔ dnf install X

    Same job. `apt-get` is the script-stable front end; plain `apt` warns that its interface may change.

    Full guide
  • dpkg -l X ↔ rpm -q X

    Is it installed. `ii` on Debian is two letters - what you want, and what is true. rpm prints the full NEVRA instead.

    Full guide
  • dpkg -S <path> ↔ rpm -qf <path>

    Which package owns this file.

    Full guide
  • dpkg -L X ↔ rpm -ql X

    What did this package install. Counts never match across families - packaging policy differs, not the software.

    Full guide
  • apt-file search <path> ↔ dnf provides <path>

    Find a package you do NOT have. dnf has it built in; apt needs `apt-file` installed and `apt-file update` run once.

    Full guide
  • apt-get purge X ↔ (no equivalent)

    Only Debian keeps config files after a remove - the `rc` state. rpm takes them with it, saving `.rpmsave` only where you had edited them.

    Full guide
  • apt-mark hold X ↔ exclude=X in dnf.conf

    Pin a version. dnf also has `versionlock`, which is a separate plugin and often not installed.

    Full guide
  • /etc/apt/sources.list.d/*.sources ↔ /etc/yum.repos.d/*.repo

    deb822 stanzas against ini sections. A dead repo is a warning to apt and a HARD FAILURE to dnf unless `skip_if_unavailable=1`.

    Full guide

Services and logs

  • systemctl restart ssh ↔ systemctl restart sshd

    The unit is named `ssh` on Debian and Ubuntu, `sshd` on RHEL. One of the few places systemd itself differs.

    Full guide
  • journalctl ↔ journalctl

    Identical. But Ubuntu keeps a persistent journal in `/var/log/journal` by default and some minimal images do not - check before promising history.

    Full guide

Networking

  • /etc/netplan/*.yaml ↔ /etc/NetworkManager/system-connections/*

    Where addressing is written down. The two families share NO configuration file, which is why exam tasks ask for a result and not a file.

    Full guide
  • netplan try ↔ (no equivalent)

    netplan reverts after 120 seconds unless confirmed. NetworkManager has no such safety net, so `nmcli connection up` on your own interface is riskier.

    Full guide
  • resolvectl status ↔ cat /etc/resolv.conf

    On Ubuntu resolv.conf is a symlink to a stub listing 127.0.0.53 and tells you nothing. On RHEL the file IS the answer.

    Full guide
  • ufw allow 22/tcp ↔ firewall-cmd --add-service=ssh --permanent

    Both write nftables underneath. ufw ships inactive on Ubuntu; firewalld ships RUNNING on RHEL - a real difference in default posture.

    Full guide
  • ufw status numbered ↔ firewall-cmd --list-all

    ufw lists NOTHING while inactive, even though the rules are on disk. Enable first, then check, or read `/etc/ufw/user.rules`.

    Full guide

File systems

  • mkfs.ext4 (default) ↔ mkfs.xfs (default)

    Ubuntu defaults to ext4, RHEL to xfs. Both grow online; only ext4 can shrink, and only while unmounted.

    Full guide
  • resize2fs <dev> ↔ xfs_growfs <mountpoint>

    Note the argument: ext4 takes the DEVICE, xfs takes the MOUNT POINT. `lvextend -r` picks the right one for you.

    Full guide
  • tune2fs -m 1 <dev> ↔ (no equivalent)

    Only ext4 has a tunable root reserve. xfs keeps a small internal reservation that cannot be changed.

    Full guide
  • df -i matters ↔ df -i rarely matters

    ext4 fixes its inode count at mkfs time and can exhaust it. xfs allocates inodes dynamically and effectively cannot.

    Full guide
  • /swap.img file ↔ swap partition on LVM

    What each installer creates. Both are ordinary; a file is far easier to resize, which is why swap files have largely won.

    Full guide