2

What's the simplest way to get codenames of currently supported Ubuntu releases for use in deb packaging? Like utopic trusty precise lucid for today.

2 Answers 2

5

Use distro-info:

$ distro-info --supported
lucid
precise
trusty
utopic
vivid

You may need to sudo apt-get install distro-info first. The tool takes its information from the package distro-info-data, which is updated in all supported releases when release data changes.

2
  • How did vivid get in there?
    – muru
    Dec 2, 2014 at 13:29
  • Looks like distro-info defines "supported" as "created but not EOL", which includes Vivid. You could use distro-info --devel to get the name of the development release and then exclude it. Dec 2, 2014 at 13:51
0

I don't think the current release has any idea about the names of the previous releases. You will need to get that information online.

https://wiki.ubuntu.com/Releases is a good candidate

This will do the job until they reformat that page:

wget -q https://wiki.ubuntu.com/Releases -O - | sed -n -l 999 /Current/,/Future/l | grep '^ <td style="background-color: #f1f1dd"><p class="line891">' | grep -v http | grep -v /ReleaseNotes | cut -d ">" -f 4 | cut -d "<" -f 1 | sort | uniq | cut -d " " -f 1 | tr '[:upper:]' '[:lower:]'

Output:

lucid
precise
trusty
utopic

Explanation:

  • wget retrieves the web page with the releases,
  • sed cuts the lines between Current and Future
  • 3 * grep filters out some unwanted table cells
  • 2 * cut takes only the cell with the code name (2 words - like "Trusty Tahr", etc)
  • sort and uniq removes the duplicates
  • the next cut gives you the firs word only (the adjective)
  • tr makes it lowercase
1
  • distro-info --supported is simple :)
    – Alex Jones
    Dec 2, 2014 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .