Many install guides work only on certain Ubuntu releases, so the first thing to know is which version you’re running. On Ubuntu, one command shows it: lsb_release -a.
Every command and output on this page is real, from Ubuntu 26.04 LTS.
Syntax
lsb_release [options]
lsb_release: prints information about the Ubuntu release you’re running. On Ubuntu 26.04 it reads it from the file/etc/os-release.[options]: what to show.-ashows everything: the distributor, the description, the release number and the code name.-d,-rand-cshow one of them each, and-sleaves out the labels.
The options come from lsb_release’s manual page (opens in a new tab) for Ubuntu 26.04.
Step 1: Check Your Ubuntu Version
Open a terminal on Ubuntu and run:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 26.04.1 LTS
Release: 26.04
Codename: resolute
Here’s what each line tells you:
- Distributor ID: the Linux distribution, Ubuntu.
- Description: the full name, with the point release (26.04.1) and LTS when it’s a long-term support release.
- Release: the version number. Ubuntu numbers its versions by the year and month they came out, so 26.04 is April 2026.
- Codename: the release’s code name. Software repositories, such as the PostgreSQL one, use it to give you the packages built for your release.
The first line, No LSB modules are available., is normal, and you can ignore it.
FAQ
What does LTS mean?
Long-term support. Ubuntu releases a new version every six months, and every two years one of them is an LTS release with 5 years of standard security maintenance. The releases in between get 9 months of updates. For a server, pick an LTS release.
How do I show just the code name?
Add -c for the code name and -s to leave out its label:
lsb_release -cs
resolute
Do I need sudo to check the version?
No. lsb_release only reads information, so any user can run it.
Conclusion
lsb_release -a shows your Ubuntu version in one command: its release number, its full name and its code name. Check it before you follow a guide that supports only some releases, such as How to Install PostgreSQL 19 on Ubuntu.
Additional Resources
- Ubuntu manual page: lsb_release (opens in a new tab)
- Ubuntu manual page: os-release (opens in a new tab)
- Ubuntu release cycle (opens in a new tab)
0 comments