CLI: Get information Ubuntu releases

Solution 1:

ubuntu-distro-info from the distro-info Install distro-info package provides information about all Ubuntu releases.

You get an overview of all releases with

ubuntu-distro-info --all --fullname

For the "current" version

ubuntu-distro-info --stable --fullname

For the current LTS release

ubuntu-distro-info --lts --fullname

For currently supported releases

ubuntu-distro-info --supported --fullname

(This strangely includes the current development version although it is not supported yet)

To get the number of days till EndOfLive you add --days=eol (shorter -yeol)

ubuntu-distro-info --supported --fullname --days=eol

To get the number of days till the current development version will be released you can use just -y or --days

ubuntu-distro-info --latest --fullname --days

Solution 2:

Also a general way (works also on non-Ubuntu distros as well):

lsb_release -a

It uses /etc/os-release to read the config data. On .deb-based distros, also /etc/dpkg should correct as so. After a manual shift to/from Ubuntu, this should be manually corrected.