Home / Alt manpages / distro-info(1)

  • distro-info(1)
  • User command
  • linux

Check Ubuntu Release Support and Dates with distro-info

Your script needs to know whether Ubuntu 22.04 is still supported, and distro-info answers that in one line instead of a spreadsheet. This gives you commands that identify the current Ubuntu release, list supported series, turn codenames into release names, and calculate days to a release or end-of-life milestone. The examples use distro-info from package version 1.7build1 on this machine, where the command is a symlink to ubuntu-distro-info.

Allow about ten minutes. You need a shell and the installed distro-info package. These checks only read the package's release data and do not need elevated privileges. They do not update that data, change APT sources, or alter the operating system.

1. Confirm the command and its distribution

Start by checking the executable and package version:

$ command -v distro-info
/usr/bin/distro-info
$ dpkg-query -W distro-info
distro-info 1.7build1

The generic name is useful in scripts, but its output is distribution-specific. The local manual says Debian links it to debian-distro-info and Ubuntu links it to ubuntu-distro-info. Options outside the generic manual can therefore differ. On this Ubuntu installation, --lts and --supported-esm are available in the command help, but they are not generic distro-info options described by the installed manual.

Checkpoint

Run distro-info --help and compare any distribution-specific option with the command's own help before putting it in a portable script.

2. Select a release before choosing its format

A bare invocation is an error because the command needs exactly one selector such as --stable, --devel, --all or --series:

$ distro-info
ubuntu-distro-info: You have to select exactly one of --all, --devel, --latest, --lts, --stable, --supported, --supported-esm, --series, --unsupported.
$ printf 'exit status: %s\n' "$?"
exit status: 1

Use --stable for the latest stable codename, then add an output format. The default format is the codename; --release prints the numeric release, and --fullname includes the Ubuntu name:

$ distro-info --stable
resolute
$ distro-info --stable --release
26.04 LTS
$ distro-info --devel --fullname
Ubuntu 26.10 "Stonking Stingray"

The values above are the installed release data as observed on 23 September 2026. They are not permanent answers. A later package update, or a different date-aware data set, can change which release is stable or development.

3. List the support sets

Use --supported when a deployment should consider releases that the local data marks as supported, including the development release. Use --unsupported for old stable releases. Add --release when a machine-readable numeric release is more useful than a codename:

$ distro-info --supported --release
22.04 LTS
24.04 LTS
26.04 LTS
26.10
$ distro-info --unsupported --release
4.10
5.04
5.10
6.06 LTS
...
25.10

The command prints one result per line. The unsupported list is long, so the abbreviated display above is only for readability; your terminal will receive every known unsupported stable release. Do not infer support from an age estimate or from a codename. Use the command's current data, and remember that extended commercial support is a separate question from the ordinary supported set.

For a script, capture the output as lines rather than splitting on spaces, because --release can include the text LTS:

while IFS= read -r release; do
    printf 'supported release: %s\n' "$release"
done < <(distro-info --supported --release)

4. Resolve a known series

Use --series=SERIES when you need a particular release rather than whichever release is currently stable. Series values are codenames, not numeric versions:

$ distro-info --series=jammy --fullname
Ubuntu 22.04 LTS "Jammy Jellyfish"
$ distro-info --series=jammy --release
22.04 LTS

This is a useful guard before generating a repository path, report or compatibility matrix. An invalid series is an error and returns status 1:

$ distro-info --series=not-a-series --release
ubuntu-distro-info: invalid distribution series 'not-a-series'
$ printf 'exit status: %s\n' "$?"
exit status: 1

Warning

Do not silently replace a failed lookup with the current stable release. That can send a deployment check or package report towards the wrong series. Test the status explicitly:

if release=$(distro-info --series="$SERIES" --release); then
    printf 'Ubuntu series %s is %s\n' "$SERIES" "$release"
else
    printf 'Unknown Ubuntu series: %s\n' "$SERIES" >&2
    exit 1
fi

Set SERIES to an intentional value before using this example, for example SERIES=jammy. Treat it as data, not as an option string assembled from untrusted input.

5. Calculate days to a milestone

The --days option appends the number of days until a milestone. Valid milestones in the generic manual are created, release, eol and eol-server. If you omit the milestone, release is assumed. Combine it with --release or --fullname if the result needs a label:

$ distro-info --days=eol --series=jammy --release
22.04 LTS 251
$ distro-info --days=release --stable --release
26.04 LTS -153

A positive value means the milestone is in the future. A negative value means it has already passed. The second example is therefore not a countdown to run blindly: it says the stable release's release milestone is 153 days in the past relative to the command's date.

For a list selector, the normal output is followed by the day count on each line. With no name option, the command can return only numbers for the day calculation, as described by the Ubuntu-specific manual. Prefer an explicit format when people or logs need to identify the release:

$ distro-info --supported --days=eol --release
22.04 LTS 251
24.04 LTS 981
26.04 LTS 1709
26.10 295

Those dates are data-dependent. If a milestone is not meaningful for a series, the command can print (unknown); handle that as an unavailable value rather than converting it to zero.

6. Make a check reproducible on another date

By default, the calculation uses today. The manual also permits --date=DATE, using a date in the command's accepted format, so a report can be reproduced without depending on when it is rerun. For example:

$ distro-info --date=2024-04-25 --series=jammy --release
22.04 LTS

The date changes milestone calculations, not the identity of a fixed series. If SOURCE_DATE_EPOCH is set, the generic manual says it is used as the default epoch instead of today. Check the environment when two apparently identical jobs produce different day counts:

if [ -n "\${SOURCE_DATE_EPOCH:-}" ]; then
    printf 'SOURCE_DATE_EPOCH is set; date-sensitive output is reproducible from that epoch\n'
fi
distro-info --stable --release

Do not export a made-up epoch just to force an answer. Use an explicit --date for a report whose reference date is known, or clear the environment in the calling job if it was set accidentally. Neither choice changes package data.

Done means

  • distro-info --help identifies the distribution-specific command you are using.
  • You select exactly one release set before adding --codename, --release or --fullname.
  • Series lookups check the command status and do not fall back silently.
  • Support and milestone results are treated as time-sensitive data, with explicit dates where reproducibility matters.