The Dependency Vector
When you take over the administration of an existing Ubuntu server, the absolute first piece of information you must acquire is the exact version of the operating system currently running. Attempting to install modern database software or compile specific networking drivers on an outdated version of Ubuntu (like 18.04 LTS) will result in massive dependency failures and broken packages. You must know if the machine is running a Long Term Support (LTS) release, or an interim release that will suddenly lose security patches.
How to Find Your Ubuntu Version
The Linux kernel maintains a dedicated text file specifically designed to broadcast the release information of the installed distribution.
1. Open your terminal application or connect to your server via SSH.
2. The standard, universal command to query this information across almost all Debian-based distributions is lsb_release (Linux Standard Base). Execute the following command:
lsb_release -a
3. The terminal will output a short block of highly specific data. You are looking for two lines:
* Description: This gives you the full, human-readable name (e.g., `Ubuntu 22.04.3 LTS`).
* Codename: This gives you the internal development name (e.g., `jammy` or `focal`), which is crucial when manually adding third-party software repositories.
4. Alternative Method: If for some reason the lsb_release package is missing from a highly stripped-down server image, you can directly interrogate the core system identification file by executing:
cat /etc/os-release
This command will dump a massive list of variables directly to your screen, but the PRETTY_NAME and VERSION_ID lines will provide the exact same critical version data.