Query Ubuntu Release Status Reliably with ubuntu-distro-info
You will finish with commands that answer practical release questions: which Ubuntu series is stable, what its codename and full version are, which series are supported, and how far a release is from a milestone. The examples use ubuntu-distro-info from distro-info package version 1.7build1.
The route
Jump straight to the step you need, or tick off Done means at the end.
Allow about ten minutes. You need a shell and the distro-info package. Every command in this guide is read-only. No sudo is required, and the examples do not alter APT, release files or system configuration.
1. Check the installed command
Start with the binary and its help output. This catches the common mistake of reading a manpage from one package version while running another:
$ command -v ubuntu-distro-info
/usr/bin/ubuntu-distro-info
$ dpkg-query -W -f='${Package} ${Version}\n' distro-info
distro-info 1.7build1
$ ubuntu-distro-info --help
Usage: ubuntu-distro-info [options]
Options:
-h --help show this help message and exit
--date=DATE date for calculating the version (default: today)
--series=SERIES series to calculate the version for
-y[MILESTONE] additionally, display days until milestone
--days=[MILESTONE] (created, release, eol, eol-server, eol-esm)
The help output is the installed command's contract. In this package it lists eol-esm, which is not listed in the older local manual page. If a script depends on that milestone, check --help on the target host rather than assuming all distro-info versions match.
2. Select exactly one release set
The command does not choose a default release query. You must select one of --all, --devel, --latest, --lts, --stable, --supported, --supported-esm, --series or --unsupported. The output mode is separate: --codename is the default, while --release and --fullname request other fields.
For a stable release, pin the date when you need a reproducible result. Without --date, the command uses today, so its answer changes as Ubuntu publishes new data:
$ ubuntu-distro-info --stable --date=2026-09-27
resolute
$ ubuntu-distro-info --stable --release --date=2026-09-27
26.04 LTS
$ ubuntu-distro-info --stable --fullname --date=2026-09-27
Ubuntu 26.04 LTS "Resolute Raccoon"
Use a real ISO date in scripts. The date is used for release selection and milestone calculations, not for changing the machine clock. A date before or after a release can therefore select a different stable series.
Checkpoint
If you get the message about selecting exactly one query, add one release selector. If you get an invalid series error, check its spelling instead of trying sudo:
$ ubuntu-distro-info --series=not-a-series
ubuntu-distro-info: invalid distribution series `not-a-series'
$ printf 'exit status: %s\n' "$?"
exit status: 1
3. Inspect a known Ubuntu series
--series is useful when a deployment, support table or test matrix names a codename. It accepts the series codename and prints that series unless another output mode is requested:
$ ubuntu-distro-info --series=jammy
jammy
$ ubuntu-distro-info --series=jammy --release
22.04 LTS
$ ubuntu-distro-info --series=noble --fullname
Ubuntu 24.04 LTS "Noble Numbat"
Keep the output mode explicit in scripts. A codename is stable as an identifier, while a full name is better for a report intended for people. Do not parse the full name to recover the series; pass the known codename to --series when you need a precise lookup.
4. List supported and unsupported series
Use --supported for the supported set, including the development release. Use --unsupported for older stable releases. Add --release if the report should contain version numbers instead of codenames:
$ ubuntu-distro-info --supported --release --date=2026-09-27
22.04 LTS
24.04 LTS
26.04 LTS
26.10
$ ubuntu-distro-info --supported-esm
bionic
focal
jammy
noble
resolute
--supported-esm describes the Ubuntu Advantage or Ubuntu Pro supported stable set. It is not the same question as ordinary support, and a series appearing in this list does not mean a normal installation receives all updates without the relevant entitlement.
Distraction trap: --all is not a supported-release check. It includes historical and future series known to the installed data. Use it when you need the complete data set, not when deciding whether an upgrade target is supported.
5. Calculate days to a milestone
Add --days with a milestone to calculate the number of days from the selected date. The documented milestones are created, release, eol and eol-server; this installed version also advertises eol-esm. A negative number means the milestone has already passed:
$ ubuntu-distro-info --series=jammy --release --days=release --date=2026-09-27
22.04 LTS -1620
$ ubuntu-distro-info --series=jammy --days=eol --date=2026-09-27
247
When the query returns a list, the normal output and its day count are printed on each line. This makes a compact report possible:
$ ubuntu-distro-info --supported --release --days=release --date=2026-09-27
22.04 LTS -1620
24.04 LTS -885
26.04 LTS -157
26.10 18
Some milestones do not apply to every release. For example, --all --days=eol-server prints (unknown) for releases without a server EOL date. Treat that as missing data, not as zero days or proof that the release is supported.
6. Put the result in a shell check
For automation, prefer a pinned date and a narrow selector. Capture the value as data, then compare it with an expected series. This example does not change state and fails clearly if the stable series is not the one you expected:
stable=$(ubuntu-distro-info --stable --date=2026-09-27) || exit 1
if [ "$stable" != "resolute" ]; then
printf 'unexpected stable series: %s\n' "$stable" >&2
exit 1
fi
printf 'stable series: %s\n' "$stable"
Do not hard-code a future series in an upgrade script without a separate readiness decision. This command reports distro-info data; it does not test hardware compatibility, third-party repositories, disk space or whether an upgrade is safe.
Done means
- You checked the installed package version and help output.
- You select exactly one release query and choose the output field deliberately.
- You use
--seriesfor a known codename and reject invalid input. - You distinguish ordinary support, ESM support and the complete historical data set.
- You pin
--date=YYYY-MM-DDwhen a result must be reproducible. - You interpret negative day counts and
(unknown)without turning them into upgrade decisions.