How do I know when my Ubuntu was installed?

Oliver Grawert ogra at ubuntu.com
Sun Sep 4 22:48:11 UTC 2016


hi,
On So, 2016-09-04 at 14:10 +0300, Amichai Rotman wrote:
> Hi,
> Is there a way to check when was my Ubuntu installed?
> It would be nice to be able to enter the command 'born' in a terminal
> and get a line with the date and time of the first boot...

all official installers write their logs to /var/log/installer/ at
installation time, you could just look at the timestamps ...

installations from 12.04 onwards should also have the file
/var/log/installer/media-info in case you want to know which iso was
used for the install.

and as ralf pointed out the creation time of /etc/hostname would also
be a measure, or the creation time of /etc/machine-id (which is a file
that dbus creates on the very first boot of a system) but sadly the ls
command will only give you the last modification time and there is no
easy way in linux to get the actual creation time of a file with user
accessible tools (if the hostname was ever changed since the install
your tool would indeed lie or if /etc/machine-id was ever manually
deleted it would have been re-created newly).
 
if you want a reliable creation timestamp you have to dig a bit deeper
into the inode of the file with the debugfs command like:

debugfs -R 'stat <inode_number>' DEVICE

on my desktop machine this looks like:

ogra at anubis:~$ stat -c %i /etc/hostname 
2359306
ogra at anubis:~$ sudo debugfs -R 'stat <2359306>' /dev/sda1|grep crtime
debugfs 1.42.13 (17-May-2015)
crtime: 0x4fedea8b:8b968b14 -- Fri Jun 29 19:48:59 2012

ciao
	oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160905/71a9306a/attachment.sig>


More information about the ubuntu-users mailing list