7

How can I determine when Ubuntu was installed in my computer? There was a different question posted here.

6
  • 5
    What was wrong with the answers there? /var/log/installer, /boot, and dumpe2fs all look OK to me. Commented Feb 9, 2011 at 10:41
  • @Mikel. The reason is that they show different dates. For instance, dumpe2fs and /var/log/installer show creation date as 05.11.2010 while /boot shows as 29.01.2011. That is why I wanted to find out precise method to get this information without any doubts. Commented Feb 9, 2011 at 11:27
  • 3
    @Bakhtiyor Then most probably something happened to /boot. When dumpe2fs and /var/log/installer point to the same answer I won't keep any doubt. Commented Feb 9, 2011 at 11:49
  • All right guys. So, what do you suggest me to do with the question? Just delete it or what? Commented Feb 9, 2011 at 11:52
  • @Bakhtiyor If you still think something is wrong and you need help with it please edit your question to include that information. Or if you question has already been answered on the other site you can close this one. Commented Feb 9, 2011 at 13:36

4 Answers 4

7
sudo dumpe2fs $(mount | awk '/on \/ /{print $1}') | grep 'created:' 

Use this command for check when was the OS installed.

3
  • 2
    Thanks, this works! I would add "sudo" for completeness. Commented 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. Commented Jul 20, 2021 at 9:23
  • this finally worked on my ubuntu server pi, thanks Commented Feb 12, 2022 at 10:25
6

As I found here sudo grep ubiquity /var/log/installer/syslog | less should work for Ubuntu.

last works for Fedora.

1
  • 2
    Won't last suffer from the same issue with wtmp rotation? Commented Feb 10, 2011 at 22:18
1

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.

8
  • 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. Commented Feb 9, 2011 at 15:33
  • 2
    @Bakhtiyor Try grep ubiquity /var/log/installer/syslog | less. I found that here Commented Feb 9, 2011 at 15:41
  • 3
    I 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. Commented 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. Commented Feb 9, 2011 at 15:58
  • 1
    wtmp gets rotated. See /etc/logrotate.conf. Commented Feb 9, 2011 at 21:10
0

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.