Before following a tutorial, installing a package or opening a support ticket, you need to know exactly what you’re running: which distribution, which release, which kernel and which CPU architecture. These commands answer all of that.
The distribution and release
/etc/os-release (works everywhere)
cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.3 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
This file exists on every modern distribution (systemd-based or not). VERSION_CODENAME is what repository URLs use (noble, bookworm, trixie). ID_LIKE tells you the family — useful in scripts:
. /etc/os-release && echo "$ID $VERSION_ID ($VERSION_CODENAME)"
hostnamectl
hostnamectl
Shows the OS, kernel, architecture and — on VPS — the virtualization type (Virtualization: kvm).
lsb_release
lsb_release -a
Available on Debian/Ubuntu (package lsb-release); often not installed on minimal or RHEL-family systems.
Distribution-specific files
cat /etc/debian_version # Debian (and Ubuntu shows its Debian base)
cat /etc/redhat-release # RHEL, AlmaLinux, Rocky, CentOS
cat /etc/almalinux-release
cat /etc/rocky-release
The kernel
uname -r # kernel release, e.g. 6.8.0-88-generic
uname -a # everything: kernel, hostname, build date, architecture
cat /proc/version
The kernel version is independent of the distribution release: Ubuntu’s HWE kernels, for instance, give an LTS release a newer kernel. After a kernel update, uname -r still shows the old one until you reboot.
ls /boot/vmlinuz-* # installed kernels
See uname and kernel versions.
The architecture
uname -m # x86_64, aarch64…
dpkg --print-architecture # amd64, arm64 (Debian/Ubuntu)
arch
Download the right binaries: amd64/x86_64 for Intel/AMD, arm64/aarch64 for ARM servers.
Virtualization
systemd-detect-virt # kvm, vmware, lxc, none…
kvm means a full virtual machine — you can change kernels and load modules. lxc or openvz mean a container, with restrictions. See KVM vs OpenVZ vs LXC.
Is my release still supported?
Running an end-of-life release means no more security updates. Check:
- Ubuntu: LTS releases get 5 years of standard support (more with Ubuntu Pro); interim releases only 9 months.
ubuntu-security-statusorpro statusshow coverage. - Debian: about 3 years of security support plus ~2 years of LTS per release.
- AlmaLinux / Rocky / RHEL: about 10 years per major version.
- CentOS 7 reached end of life in mid-2024, and CentOS Stream 8 in 2024 — migrate if you still run them. See CentOS 7 migration.
The endoflife.date website lists dates for most distributions and software.
One-liner for support tickets
echo "$(. /etc/os-release; echo $PRETTY_NAME) | kernel $(uname -r) | $(uname -m) | $(systemd-detect-virt)"
Ubuntu 24.04.3 LTS | kernel 6.8.0-88-generic | x86_64 | kvm
Other useful version checks
openssl version
nginx -v
php -v
mysql --version
python3 --version
node -v
docker --version
systemctl --version | head -1
Upgrading the release
When it’s time to move to a newer release:
- Ubuntu:
sudo do-release-upgrade— see upgrading Ubuntu. - Debian: update
sources.listcodenames andapt full-upgrade— see upgrading Debian.
On a VPS, a fresh install of the new release plus migrating your data is often cleaner than an in-place upgrade. Our VPS plans let you reinstall the OS from the control panel in a few minutes.