Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given a machine that may or may not have been through a number of release upgrades, how can I find out the version of Ubuntu that was originally installed? Assuming that logging configuration has not been changed from default.

share|improve this question
You mean "release upgrade"? because dist-upgrade is not what take from an ubuntu release to the next. – enzotib Jul 24 '11 at 5:55
Yes, that's what I meant, sorry. – Mykro Jul 27 '11 at 1:29
up vote 7 down vote accepted

If you have not done manual modifications, you should see the utilised installation media on the top of /etc/apt/sources.list:

# deb cdrom:[Kubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100427)]/ lucid main restricted
# See for how to upgrade to
# newer versions of the distribution.

Apport (the Ubuntu bug reporter) uses /var/log/installer/media-info to determine the installation media which contains:

Kubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100427)

This only works if you kept the /var/log/installer folder.

share|improve this answer
Both of the suggestions (/etc/apt/sources.list and /var/log/installer/media-info) worked - they indicated on a 11.04 machine that 10.10 was the original installation. Thank you! – Mykro Jul 27 '11 at 1:41

You can go to see older dpkg.log file available on the system, and take the older package reported on that:

less $(ls -rt /var/log/dpkg.log* | 
  head -1) | 
  awk 'NF == 6 && $3 == "install" { print $4, $6; exit }'

then go to and see to what release of ubuntu it belongs.

But this is not errors free, because older dpkg logs can be removed, depending on logrotate policy.

share|improve this answer
Thanks for this suggestion. It's a little tricky because Ubuntu automatically zips up older log files, but I was able to unzip them and retrieve the original install package: "base-files 5.0.0ubuntu23". I got tied up finding the right place at to query this. But I can see this answer would be a handy option when other alternatives fail. – Mykro Jul 27 '11 at 1:38
The command I gave take care of gzipped files too. – enzotib Jul 27 '11 at 6:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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