4

Is there a way or maybe even a command to check out if the installation has been upgraded from previous versions? I have some servers that I know have been upgraded from for instance 8.04 to 12.04 and are having issues to be upgraded to 14.04 and would like to find out if the problem with these machines may have to do with te followed upgrade path.

If this can be found out it will be way easier for me to determine if I should do a clean install for the servers that cannot be upgraded.

1
  • 7
    This sounds like an XY problem. Could you be more specific about "having issues"? Feb 11, 2016 at 8:59

2 Answers 2

8

I doubt there is a perfect method. A method could be to check the date of creation of the filesystem:

 sudo tune2fs -l /dev/sda1  | grep 'Filesystem created:'
 Filesystem created:       Thu Mar  5 15:51:50 2015

The system I pulled this from was created on March 5th 2015. Of course it is entirely possible to install 14.10 on March the 5th and then upgrade to 15.04 so it is no perfect method.

Since ...

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.04
DISTRIB_CODENAME=vivid
DISTRIB_DESCRIPTION="Ubuntu 15.04"

the system is 15.04 I would assume it is an installed version and not an upgrade. In hindsight: March 5th probably was the day of the 15.04 got frozen (?)


You can also check ...

/var/log/dist-upgrade/

total 212
-rw-r--r-- 1 root root   1786 apr 24  2015 apt.log
-rw-r----- 1 root adm  169074 apr 24  2015 apt-term.log
-rw-r--r-- 1 root root  33191 apr 24  2015 history.log
-rw-r--r-- 1 root root      0 apr 24  2015 main.log.partial
-rw-r--r-- 1 root root      0 apr 24  2015 term.log

history.log will have lots of information. That file might be purged on your systems though, but if present will show you if it was an upgrade.

If the logs survived, they could show, for example in a system upgraded from 12.04:

$ grep lsb-release: /var/log/dist-upgrade/main.log
2015-03-14 10:18:36,284 DEBUG lsb-release: 'precise'
2
  • In particular, /var/log/dist-upgrade/main.log could contain a line mentioning which version the upgrade happened from grep lsb-release: /var/log/dist-upgrade/main.log.
    – muru
    Feb 11, 2016 at 9:11
  • thanks .. found out some of the installation had file systems that were created back in 2010.
    – Solko
    Feb 12, 2016 at 19:52
2

Not water-proof but another possibility, if the entry was not removed:

$ grep cdrom /etc/apt/sources.list 
# deb cdrom:[Ubuntu-GNOME 15.10 _Wily Werewolf_ - Release amd64 (20151021)]/ wily main multiverse restricted universe

That means, you probably have installed your system with a Wily DVD.

1
  • The method correctly estimates that my system was upgraded from 14.04 too 16.04 but fails to see that that 14.04 was previously a 12.04.
    – Thijser
    Feb 11, 2016 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .