I'm trying to contribute with Docker's install script by providing auto distribution detection support for elementary OS, so, elementary OS users would be automatically detected when using Docker's official install script.

The script will add an apt repository with the following command:

echo "deb https://apt.dockerproject.org/repo ${lsb_dist}-${dist_version} ${repo}" > /etc/apt/sources.list.d/docker.list

Where lsb_dist=elementary, dist_version=freya and repo=main in Freya.

After that it'll do apt-get update and install the "docker-engine" package.

Though, Docker apt repository doesn't have entries for elementary OS. I've tested using "ubuntu-trusty" repository and it works just fine in Freya.

So, I want to use Ubuntu repositories to setup Docker for elementary, but I would like to avoid hard coding elementary OS correspondent base Ubuntu versions, if that's possible.


Is there a file or command which will tell me what's elementary OS' base Ubuntu version, and works in all elementary OS versions?


4 Answers 4


You can find the "upstream release" codename using the -u flag with lsb_release commands. Try it with the following command in Terminal:

lsb_release -a -u

On Freya, it gives me the following output:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty

Without the -u flag, you'll get our info as follows:

No LSB modules are available.
Distributor ID: elementary OS
Description:    elementary OS Freya
Release:    0.3
Codename:   freya
  • Wow! You rock man! That's definitely the best answer! How silly of me not trying all lsb_release --help options. Thanks a lot!
    – fmoliveira
    Jul 26, 2015 at 2:50
  • Credit to Cody Garver. He's just a bit busy to post here himself ;p Jul 26, 2015 at 2:58
  • 1
    For command line usage it might be good to include lsb_release -cus, which gives just the ubuntu codename. Nov 11, 2018 at 9:04

You can use uname -v which gives the full Ubuntu based version unlike the other answers. Output is below :

#49~14.04.1-Ubuntu SMP Thu Dec 31 15:44:49 UTC 2015

If you need to only print the version (like in scripts) you can useuname -v | cut -c 5- | cut -f1 -d"-" which prints 14.04.1 on my laptop. Any improvements for the command that only prints the version are welcome

  • Any improvements my command that shows only the version
    – Suici Doga
    Jan 19, 2016 at 14:34

You can find it in the Settings/About page.


Every version of elementary OS is built on top of the current Ubuntu's LTS versions. I don't think that there's a command that will tell you that, but here's what was done so far:

  • elementary OS Jupiter was built on top of the Ubuntu 10.04 (thanks to PNG for the confirmation).
  • elementary OS Luna was built on top of the Ubuntu 12.04.
  • elementary OS Freya was built on top of the Ubuntu 14.04.
  • elementary OS Loki (note: the code name for this version might be changed) will probably be built on top of the Ubuntu 16.06 version (at the moment, there is no official confirmation nor denial).

Example: Node.js setup script has alternative distros all hard coded.

  • 1
    Jupiter was built on top of the Ubuntu 10.10. About Loki was no official information.
    – png2378
    Jul 25, 2015 at 22:33
  • I was not confirmed, that Jupiter built on the 10.04 :-)
    – png2378
    Jul 26, 2015 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.