You might have to change the /dev/sda1 to reflect your setup.
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 "creation time".
Similar tools and info might be available on other file systems as well, but I don't know of them.
If the installation is recent, look at the oldest entries under /var/log, but after a few weeks the logs will have been rotated away.
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 /etc/hostname; other candidates are /etc/hosts, /etc/papersize, /etc/popularity-contest.conf.
I also don't know of a specific command or file. I'm using some heuristics to find the installation date:
for dir in {/etc,/usr,/lib}; do
sudo find $dir -type f -exec stat -c %z {} \; | \
sed -e 's,-,,g' -e 's, .*,,' | sort | uniq -c | sort -nr -k 2 | \
grep -Ev " [0-9]?[0-9] "
done
This small script looks for files in /etc and /usr and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.
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.
would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?
You can check the installer logs and dates at:
A quick way to find the date through the command line would be by running:
That lists in reverse chronological order so the oldest file is at the bottom of the list.
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
/dev/sda1
to reflect your setup.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 "creation time".
Similar tools and info might be available on other file systems as well, but I don't know of them.
the only command that worked for me is -
If the installation is recent, look at the oldest entries under
/var/log
, but after a few weeks the logs will have been rotated away.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
/etc/hostname
; other candidates are/etc/hosts
,/etc/papersize
,/etc/popularity-contest.conf
.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
/etc
and/usr
and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.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.
The command
sudo grep ubiquity /var/log/installer/syslog | less
worked for me very well.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.
would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?
You can type this :
Or if you have ext2/3/4 filesystem on the
/
partition, you can type this :Or if the directory
/var/log/installer
still exists :