I can never remember the mapping of Ubuntu release numbers to names. This snippet helps in situations where I can’t use Puppet’s Facter.

export UBUNTU_RELEASE=''
case $(lsb_release -a) in
    *10.04*)
        UBUNTU_RELEASE='lucid';;
    *10.10*)
        UBUNTU_RELEASE='maverick';;
    *11.04*)
        UBUNTU_RELEASE='natty';;
    *11.10*)
        UBUNTU_RELEASE='oneiric';;
    *12.04*)
        UBUNTU_RELEASE='precise';;
    *12.10*)
        UBUNTU_RELEASE='quantal';;
    *13.04*)
        UBUNTU_RELEASE='raring';;
    *13.10*)
        UBUNTU_RELEASE='saucy';;
    *14.04*)
        UBUNTU_RELEASE='trusty';;
    *)
        echo 'Could not work out Ubuntu release name!' >&2
        exit 1
esac

echo $UBUNTU_RELEASE

Ubuntu’s silly release names

Advertisements
Tagged

2 thoughts on “Ubuntu’s silly release names

  1. Marco says:

    *g* just a hint, try this:

    UBUNTU_RELEASE=$(lsb_release -sc)

    😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: