đ§ Ubuntu vs đ§ą Red Hat (RHEL)
Comparatif IDEOâLab orientĂ© production : paquets, sĂ©curitĂ©, cycle de vie, rĂ©seau, conteneurs, cloud & commandes.
ĂcosystĂšme & Cibles
Origines, variantes (Ubuntu/Debian vs Fedora/RHEL), orientations Desktop/Cloud/Entreprise.
DebianFedoraRockyPaquets & DépÎts
apt/dpkg vs dnf/rpm, AppStream, EPEL, PPA & Snap.
Cycle de vie & Support
LTS & ESM vs Subscription 10 ans, errata, SLA, Developer Edition.
LTSESMSLASécurité
AppArmor vs SELinux, Livepatch/kpatch, FIPS, hardening.
SELinuxAppArmorRéseau
Netplan & systemdânetworkd vs NetworkManager, hostname & DNS.
nmclinetplanPareâfeu
ufw & nftables vs firewalld (zones, services, rich rules).
FS & Partitionnement
ext4/Btrfs vs XFS, LVM, schémas serveur, croissance à chaud.
ext4XFSLVMServices & Logs
systemd/journalctl, différences httpd vs apache2, chemins conf.
systemctljournalctlConteneurs & Orchestration
Docker/Snap vs Podman, Buildah, OpenShift/K8s.
DockerPodmanOpenShiftCloud Images & CI/CD
AMI, images cloudâinit, runners, hardening cloud.
cloud-initAMILicences & Coûts
Gratuit + Ubuntu Pro vs RHEL Subscriptions, Rocky/Alma.
Ubuntu ProRHELCommandes équivalentes
Cartographie aptâdnf, services, rĂ©seau, firewall.
Généalogie
Ubuntu (Canonical) <- Debian (Stable/Testing/Unstable) ââ Saveur Serveur/Desktop/Cloud (LTS 5 ans + ESM) RHEL (Red Hat) <- Fedora (upstream) ââ RHEL (10 ans, support commercial) ââ CentOS Stream (preview rolling) ââ Clones 1:1 (Rocky Linux, AlmaLinux)
Cas dâusage typiques
| Contexte | Ubuntu | RHEL / Clones |
|---|---|---|
| Poste Dev / CI locale | TrĂšs populaire (Snap/PPAs rapide) | Moins courant |
| Web Apps / API | TrÚs répandu (Nginx/Node/Python) | Fréquent en entreprise |
| Prod critique & conformité | Ubuntu Pro/FIPS possible | Standard de fait (SLA) |
| Kubernetes | kubeadm, MicroK8s | OpenShift, RKE2, OKD |
apt & dpkg
sudo apt update && sudo apt upgrade -y sudo apt install nginx sudo dpkg -i paquet.deb # Niveau bas (dépendances non résolues) # PPAs & Snaps pour versions récentes sudo add-apt-repository ppa:ondrej/php -y && sudo apt update sudo snap install node --classic
dnf & rpm
sudo dnf update -y sudo dnf install nginx sudo dnf install -y epel-release # EPEL indispensable sudo rpm -q nginx && rpm -ql nginx # Interroger/vérifier des RPM
AppStream, Modules & EPEL (RHEL) / PPAs & Snaps (Ubuntu)
# RHEL - versions multiples (PHP ex.) sudo dnf module list php sudo dnf module enable php:8.2 -y && sudo dnf install php # Ubuntu - canaux alternatifs sudo add-apt-repository ppa:deadsnakes/ppa -y # Python récents sudo snap info lxd && sudo snap install lxd
Ubuntu
- LTS: 5 ans + ESM (jusquâĂ 10 ans).
- Livepatch kernel (sans reboot) via Ubuntu Pro.
- Rapidité des versions pour stacks Dev.
RHEL
- Support 10 ans (5 + 5), errata & backports testés.
- kpatch (live kernel), Red Hat Insights, Satellite.
- RHEL Developer (gratuit nonâprod) pour tests.
Tableau synthĂšse
| Aspect | Ubuntu | RHEL |
|---|---|---|
| Durée support | 5 + 5 (ESM) | 10 ans |
| Certifications | Option FIPS / CIS | FIPS, CC, DoD (large) |
| Gestion de parc | Landscape, MAAS, Canonical UA | Satellite, Insights |
# Statut AppArmor sudo aa-status # Profils enforcing/complain & gestion sudo aa-enforce /etc/apparmor.d/usr.sbin.nginx sudo aa-complain /etc/apparmor.d/usr.sbin.nginx
# Statut SELinux sestatus && getenforce # Logs et correction sudo ausearch -m AVC -ts recent | audit2allow -M fix_httpd sudo semodule -i fix_httpd.pp
# Comptes & sudo sudo useradd -m -s /bin/bash dev && sudo usermod -aG sudo dev # Ubuntu sudo usermod -aG wheel dev # RHEL # SSH sudo sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config sudo systemctl restart sshd
# /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
ens160:
dhcp4: no
addresses: [192.168.1.50/24]
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [1.1.1.1,8.8.8.8]
# Appliquer
sudo netplan apply
# Profil statique sudo nmcli connection modify eth0 ipv4.method manual \ ipv4.addresses 192.168.1.60/24 ipv4.gateway 192.168.1.1 \ ipv4.dns "1.1.1.1 8.8.8.8" sudo nmcli connection up eth0
sudo ufw default deny incoming sudo ufw allow OpenSSH sudo ufw allow 80,443/tcp sudo ufw enable && sudo ufw status verbose
sudo systemctl enable --now firewalld sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --reload && sudo firewall-cmd --list-all
Schémas conseillés
| Point de montage | Ubuntu | RHEL |
|---|---|---|
| /boot | ext4 ~1G | XFS ~1G |
| root (/) | ext4 ou Btrfs | XFS (LVM) |
| swap | swapfile possible | LV swap |
Opérations
# Agrandir LV + FS (RHEL) sudo lvextend -r -L +20G /dev/rl/root # -r = resize FS (xfs_growfs) # Vérifier sudo lvs && sudo xfs_info /
# Démarrer/activer sudo systemctl enable --now nginx # Statut + logs récents sudo systemctl status nginx sudo journalctl -u nginx -n 50 -f
# Apache # Ubuntu : paquet 'apache2', conf /etc/apache2/ # RHEL : paquet 'httpd', conf /etc/httpd/ # PHP (FPM) # Ubuntu : php-fpm service = php8.2-fpm # RHEL : php-fpm service = php-fpm (via module AppStream)
# Docker CE curl -fsSL https://get.docker.com | sh sudo usermod -aG docker $USER # MicroK8s (Snap) sudo snap install microk8s --classic microk8s status && microk8s enable dns ingress
# Podman (rootless) & Buildah sudo dnf install -y podman buildah podman run --rm -it alpine:latest sh # OpenShift (OKD pour tests) # Installer oc & utiliser CRC (CodeReady Containers) pour dev
# cloud-init user-data (extrait)
#cloud-config
users:
- name: devops
groups: [sudo]
ssh-authorized-keys:
- ssh-ed25519 AAAA...
packages: [nginx, git]
runcmd:
- [systemctl, enable, --now, nginx]
# CI/CD selfâhosted runner (ex: GitHub) sudo useradd -m runner && sudo -iu runner bash # TĂ©lĂ©charger binaire runner, enregistrer avec token ./run.sh # Installez dĂ©pendances selon distro (apt vs dnf)
| ĂlĂ©ment | Ubuntu | RHEL / Clones |
|---|---|---|
| Licence | Gratuite (open source) | Abonnement (SLA), clones gratuits (Rocky/Alma) |
| Support | Canonical (Ubuntu Pro) | Red Hat (contrats), communautés clones |
| Conformité | FIPS en option | FIPS/CC/DoD fréquents |
Paquets & SystĂšme
# Installer paquet Ubuntu : sudo apt install nginx RHEL : sudo dnf install nginx # Services Ubuntu : sudo systemctl restart apache2 RHEL : sudo systemctl restart httpd # Logs service Ubuntu/RHEL : sudo journalctl -u nginx -n 100 -f
RĂ©seau & Pareâfeu
# IP statique Ubuntu : sudoedit /etc/netplan/*.yaml && sudo netplan apply RHEL : nmcli con mod eth0 ipv4.method manual ... && nmcli con up eth0 # Firewall HTTP Ubuntu : sudo ufw allow 80,443/tcp && sudo ufw enable RHEL : sudo firewall-cmd --zone=public --add-service=http --permanent && sudo firewall-cmd --reload
# Mises Ă jour Ubuntu : sudo apt update && sudo apt upgrade -y RHEL : sudo dnf update -y # Nginx Ubuntu : sudo apt install nginx && sudo systemctl enable --now nginx RHEL : sudo dnf install nginx && sudo systemctl enable --now nginx # PHP-FPM Ubuntu : sudo apt install php8.2-fpm && sudo systemctl enable --now php8.2-fpm RHEL : sudo dnf module enable php:8.2 -y && sudo dnf install php-fpm && sudo systemctl enable --now php-fpm
- Chemins & noms :
/etc/apache2â/etc/httpd, serviceapache2âhttpd. - Modules : activer AppStream (RHEL) pour versions langages (PHP, Node, etc.).
- Firewall : traduire rĂšgles UFW â services/ports firewalld (zones).
- Sécurité : vérifier AppArmor/SELinux ; en cas de 403, valider contextes (SELinux) ou profils (AppArmor).
- CI/CD : runners et paquets buildâessentials â groupinstall "Development Tools".
