Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
3  
I'm not certain enough for an answer, but /var/log/installer could be a clue. –  Jorge Castro Oct 25 '12 at 3:04
    
I found a lot of info in the /var/log/apt/history.log –  Ringtail Nov 2 '12 at 2:50
add comment

4 Answers 4

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
share|improve this answer
3  
cat: /var/log/installer/media-info: No such file or directory on 10.10. –  gerrit Oct 25 '12 at 7:47
1  
Cool, thanks. I'll test on my other machines and report. One thing - on this particular machine I needed to run the command with sudo –  Sergey Oct 25 '12 at 8:26
    
@Sergey no need to use sudo. –  Another Googler Oct 25 '12 at 17:38
1  
It appears that this file doesn't exist on older machines - it is missing on two of my machines which initially had 8.04 and 9.10. Also, as @gerrit reports, it is missing in 10.10. –  Sergey Nov 1 '12 at 6:50
1  
@gerrit try cat /var/log/installer/lsb-release. I have an old server that I've upgraded from 8.10, according to that file. I'm guessing they've changed it some time after 8.10. –  carestad Nov 2 '12 at 1:03
show 4 more comments

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.

share|improve this answer
add comment
up vote 5 down vote accepted

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

share|improve this answer
    
I'm accepting my own answer since the most upvoted one does not seem to work on systems older than 11.04. –  Sergey Nov 9 '12 at 2:12
add comment

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. :)

share|improve this answer
1  
Interestingly, I can't find "Installation Media" in ubuntu-bug output on my machine. The only partially-related thing I found is UprgadeStatus: Upgraded to quantal on 2012-10-19 (6 days ago) –  Sergey Oct 25 '12 at 4:36
add comment

Your Answer

 
discard

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.