Check which Linux distribution and version you're running
Find out exactly which Linux distribution, release and kernel your VPS runs, using /etc/os-release, hostnamectl, lsb_release, uname and the distribution-specific release files.
- Beginner
- Linux VPS
- 4 min read
Before you follow an install guide, open a support ticket or plan an upgrade, you need to know exactly which Linux distribution and version the server runs. Package names, file paths and commands all depend on it. This guide shows several ways to check, which ones work everywhere, and how to read the kernel version.
Before you start
- SSH access to your Linux VPS. See Connect to your Linux VPS with SSH.
- No root access is needed. Every command below only reads information.
The universal answer: /etc/os-release
Every current distribution, including Ubuntu, Debian, AlmaLinux and Rocky Linux, has /etc/os-release. It is the most reliable place to look:
cat /etc/os-releaseOn Ubuntu 24.04 the output starts like this:
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debianThe fields that matter most:
PRETTY_NAME: the human-readable name and version.ID: a short lowercase name such asubuntu,debian,almalinuxorrocky.VERSION_ID: the release number, such as24.04,12or9.4.ID_LIKE: the family. Ubuntu showsdebian; AlmaLinux and Rocky show values such asrhel centos fedora. This tells you whetheraptordnfinstructions apply.
To print just one line, use grep:
grep PRETTY_NAME /etc/os-releasehostnamectl: OS, kernel and virtualization
On any system that uses systemd, hostnamectl gives a tidy summary:
hostnamectlLook for these lines:
Operating System: AlmaLinux 9.4 (Seafoam Ocelot)
Kernel: Linux 5.14.0-427.13.1.el9_4.x86_64
Architecture: x86-64
Virtualization: kvmIt shows the OS, the running kernel, the CPU architecture and the virtualization type in one place. The exact lines vary a little between systemd versions.
lsb_release on Ubuntu and Debian
lsb_release is common on Ubuntu:
lsb_release -aDistributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: nobleIt is not always installed. Debian minimal images and AlmaLinux or Rocky usually lack it, so prefer /etc/os-release in scripts. You can install it on Debian or Ubuntu with sudo apt install lsb-release.
Distribution-specific release files
Older scripts and guides sometimes read these files. They are still useful for extra detail.
Debian and Ubuntu
cat /etc/debian_versionOn Debian 12 this prints a point release, such as 12.7. On Ubuntu it prints the Debian release it is based on, such as trixie/sid, which is not the Ubuntu version. Use /etc/os-release on Ubuntu.
AlmaLinux and Rocky Linux
cat /etc/redhat-releaseRocky Linux release 9.4 (Blue Onyx)AlmaLinux also has /etc/almalinux-release and Rocky has /etc/rocky-release. All contain the same one-line summary, including the minor version.
Check the kernel with uname
The distribution and the kernel are separate. The kernel version tells you which Linux kernel is running right now:
uname -r6.8.0-45-genericOther useful forms:
uname -m: the architecture, usuallyx86_64oraarch64.uname -a: everything in one line.
After a kernel update, uname -r keeps showing the old version until you reboot. That is a quick way to tell whether a reboot is still pending.
On a VPS, the kernel comes from your own operating system, not from the host. Kernel updates arrive through normal package updates.
Is my version still supported?
Knowing the version is the first step; the second is checking it still gets security updates. Compare your VERSION_ID with the vendor's lifecycle page, or read Linux release lifecycles. On Ubuntu, ubuntu-security-status (or pro status on systems with the Ubuntu Pro client) summarises what support your packages receive.
Check it works
Run this one-liner. It prints the distribution, version and kernel together:
. /etc/os-release && echo "$PRETTY_NAME | kernel $(uname -r)"You should see something like Debian GNU/Linux 12 (bookworm) | kernel 6.1.0-26-amd64. Use that line when you open a support ticket.
Troubleshooting
- `lsb_release: command not found`: it is not installed. Use
cat /etc/os-releaseinstead. - `hostnamectl` fails inside a container: containers often run without systemd. Read
/etc/os-releasedirectly. - The version looks older than you expected: if you upgraded the release recently, check that the upgrade finished. If
uname -ris old but packages are new, reboot to load the new kernel. - `/etc/os-release` is missing: the system is very old or heavily customised. Try
ls /etc/*release*to see which release files exist.
Next steps
- Check your server's hardware next: Check your VPS CPU, RAM and disk.
- Plan ahead: Linux release lifecycles.
- Pick a distribution for your next server: Choose a Linux distro for your VPS.
- Compare Linux VPS plans.
Was this guide helpful?
Still stuck?
Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.
Related guides
Getting started
Edit files with nano: a beginner's guide
Open, edit, search and save files with the nano text editor on a Linux server, including cutting and pasting lines, showing line numbers and safely editing system config files with sudo.
- Beginner
- Linux VPS
- 5 min read
Getting started
Your first hour with a new RunRacks server
A step-by-step roadmap for the first hour after your RunRacks server is delivered, from finding your login details to changing the password, updating the OS and picking your next guides.
- Beginner
- All
- 5 min read
Getting started
How to choose a server location
Pick a data center location based on where your users, broker or team are, confirm it with ping tests, and weigh the legal and latency points that come with each choice.
- Beginner
- All
- 4 min read