This post is roughly 13 years old; originally published on March 16, 2011! The information presented here may be out of date and inaccurate.
I’m working a script to automatically backport Debian packages to Ubuntu. I needed a way to get a list of currently supported/active Ubuntu releases by codename or version. Here is how I do it.
wget -q http://cdimage.ubuntu.com/releases/ -O - | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep '^[[:space:]][a-z]' | sed 's/\///g'
wget -q http://cdimage.ubuntu.com/releases/ -O - | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | grep '^[[:space:]][1-9]' | sed 's/\///g'