is there a command which will output the date that ubuntu (or any distribution) was installed?
|
You can check the installer logs and dates at:
|
|||||||||||||
|
|
If you use ext2/ext3/ext4 and formatted the disk when you installed you can do this nifty trick.
You might have to change the Relaying on the date of files, even the "creation time" (mtime) can give errors since upgrading packages might have replaced the file and made a new "creatino time". Similar tools and info might be available on other file systems as well, but I don't know of them. |
|||
|
|
|
I also don't know of a specific command or file. I'm using some heuristics to find the installation date:
This small script looks for files in This assumes that after an installation are left unchanged. This is in most cases (according to my observation) true, but in special cases it can also give wrong results. |
|||
|
|
|
I don't think there is. On Red Hat / CentOS there is the install.log files that is generated when you install the system, but this doesn't exist on Ubuntu. Assuming your logs go back far enough ( mine do ) you can determine the date the base installation was done in /var/log/dpkg.log* For example on my system the first two lines of my oldest dpkg.log file (dpkg.log.4.gz) are
So I installed this system on 19/04/2010 at 11:40:55. That is correct for this system. There was also a brainstorm idea to add this born date. |
|||||||||
|
|
If the installation is recent, look at the oldest entries under Another thing to look at is the oldest ctime of a file on the root filesystem; but if the whole installation has been copied (e.g. rescued off a failing disk) at the directory tree level, this gives you the date of the copy. If a heuristic is good enough, look at the date (mtime) of a file that was created during the installation and is unlikely to have been modified since. A good candidate is |
|||
|
|
|
The command |
||||
|
|
|
Give this a shot:
Should work pretty reliably except if you've updated every package that was installed stock on Ubuntu :) Later edit:
should do the same thing and is shorter. |
|||||
|