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.
3 Answers
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 http://help.ubuntu.com/community/UpgradeNotes 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.

- 174,277
-
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 01: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 http://packages.ubuntu.com/ 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.

- 93,831
-
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 packages.ubuntu.com to query this. But I can see this answer would be a handy option when other alternatives fail. – Mykro Jul 27 '11 at 01:38
-
Another way is to run apport-bug
and click an option to get to the second screen ("Send problem report to the developers?").
The InstallationDate
and InstallationMedia
attributes will tell you what version installer you ran and when.

- 21
dist-upgrade
is not what take from an ubuntu release to the next. – enzotib Jul 24 '11 at 05:55