How do I tell which was the original version of Ubuntu installed on a machine?

I've got a few machines which I'm upgrading from version to version for a few years.

I'm curious to find out what was the original version of Ubuntu installed on the machine.

Is there a way to do that?


Run this command from the terminal:

cat /var/log/installer/media-info

or, if the file doesn't exist, try:

cat /var/log/installer/lsb-release

Yet another option: by default /etc/apt/sources.list contains the name of the CD from which the system was installed:

> cat /etc/apt/sources.list|grep cdrom
# deb cdrom:[Kubuntu-KDE4 8.04 _Hardy Heron_ - Release amd64 (20080423)]/ hardy main restricted

which even works on a VPS which I'm sure never been actually installed from a cdrom:

# deb cdrom:[Ubuntu-Server 10.04.2 LTS _Lucid Lynx_ - Release i386 (20110211.1)]/ lucid main restricted

Of course, /etc/apt/sources.list is relatively less hidden than anything in /var/log/installer, so chances are it had been edited manually and the cdrom entry was modified/removed.

The same data can be seen in Software Sources dialog:

enter image description here


You can see that when you report a bug using ubuntu-bug. For instance, you can press Alt+F2 and enter ubuntu-bug firefox. It'll start collecting info about your system which you can review. Among those is "Installation Media", which will show how it was originally installed. Then you just cancel the bug report, of course.

I'm not sure where apport gets this information, so someone will probably post a better answer. But this works, and that counts for something, I guess. :)


A possibly over looked option here might be to judge age through the use of time stamps. Just look and see what the time stamps are on some of the oldest files. For example, a file with a last modified dated of Jun 2010 may indicate Ubuntu 10.04.

Obviously this isn't a foolproof system, because some files can be copied onto a system with older dates than the existence of the installed Operating System. So you have to use your best judgment.