How can I determine when Ubuntu was installed in my computer? There was a different question posted here.
4 Answers
sudo dumpe2fs $(mount | awk '/on \/ /{print $1}') | grep 'created:' Use this command for check when was the OS installed.
- 2Thanks, this works! I would add "sudo" for completeness.Aram Paronikyan– Aram Paronikyan2016-06-08 12:04:17 +00:00Commented Jun 8, 2016 at 12:04
- This should be an accepted answer as it relies on filesystem creation date rather than log file that can be modified.xZero– xZero2021-07-20 09:23:23 +00:00Commented Jul 20, 2021 at 9:23
- this finally worked on my ubuntu server pi, thankssnitch182– snitch1822022-02-12 10:25:55 +00:00Commented Feb 12, 2022 at 10:25
Use last | tail -1. It helped me find the installation date on Fedora 14. The last line stating
wtmp begins Tue Nov 9 22:35:12 2010 is the installation date.
- wtmp begins Wed Feb 2 16:24:52 2011. This is what I get with last command in Ubuntu. Approximately my OS had been installed on November 2010.Bakhtiyor– Bakhtiyor2011-02-09 15:33:04 +00:00Commented Feb 9, 2011 at 15:33
- 2
- 3I wouldn't rely on that. For example, FreeBSD rotates /var/log/wtmp by default, so when I run last on one of my FreeBSD boxes I get "wtmp begins Thu Feb 3 09:50:42 EST 2011". My Slackware box does the same thing, I installed the OS on it years ago but last reports that wtmp began last week. I don't have an Ubuntu box handy to check.mazianni– mazianni2011-02-09 15:43:17 +00:00Commented Feb 9, 2011 at 15:43
- @Dharmit. sudo grep ubiquity /var/log/installer/syslog | less worked for me. Could you please post it as an answer, so that I could select your answer as an accepted one.Bakhtiyor– Bakhtiyor2011-02-09 15:58:55 +00:00Commented Feb 9, 2011 at 15:58
- 1
wtmpgets rotated. See/etc/logrotate.conf.Mikel– Mikel2011-02-09 21:10:05 +00:00Commented Feb 9, 2011 at 21:10
When dumpe2fs and findmnt are not installed (on Synology DSM v6 for example) type :
$ sudo tune2fs -l $(LANG=C df / --output=source | grep -v Filesystem) | grep created: Filesystem created: Sat Jan 1 01:00:09 2000 If a least findmnt is installed (on another system), type :
$ sudo tune2fs -l $(findmnt -n -o source -T /) | grep created: Filesystem created: Wed Sep 8 18:15:47 2021
/var/log/installer,/boot, anddumpe2fsall look OK to me./boot. Whendumpe2fsand/var/log/installerpoint to the same answer I won't keep any doubt.