Today's article helps you learn when you installed Linux.

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,497
Reaction score
9,993
Credits
95,326
This is an expended edition, due to a comment. So, it's not just for Ubuntu. Instead, I went and verified a couple other solutions and wrote the whole article over again.


Feedback is awesome.
 


Wait... I made a change after editing it and it screwed it up.

I'll fix it. This will take like five minutes.

Edit: Fixed! That's what I get for not previewing it one last time.
 
I tried in Debian and got this
Code:
$ ls -lt /var/log/installer 
ls: '/ var / log / installer' cannot be accessed: The file or directory does not exist
This one did work
Code:
sudo tune2fs -l /dev/sda5 | grep 'Filesystem created:'
Filesystem created:       Mon Mar  1 01:31:25 2021
However, you might want to edit the article and specify that here
Code:
sudo tune2fs -l /dev/sda1 | grep 'Filesystem created:'
people will need to replace /dev/sda1 with the correct drive partition, otherwise they'll get something like
Code:
tune2fs: Bad magic number in super-block while trying to open /dev/sda1
Yeah, it's just happened to me :D then I realized I needed to replace sda1 for the proper partition. Apart from that, nice article overall. :)
 
Doh! Good catch.

And, yeah, it may not be obvious that they'll need to use the right disk.

Try with sudo? I'm not sure why it wouldn't be found. I checked across a few installs and it works quite well.

Code:
sudo ls -lt /var/log/installer

Thanks!

(This has been edited a couple of times.)
 
Doh! Good catch. Try with sudo? I'm not sure why it wouldn't be found.
From a web search I learned that installer file may be deleted after the system gets installed, so that's probably why it didn't work for me. You might want to edit the post and add that as well.
 
Wait... You have spaces in your output...

ls: '/ var / log / installer'

That may be salient - and I edited it already to say that if it didn't work to try the second command and to adjust it accordingly. So, I got that covered.

Again, thanks! Feedback makes 'em better and I'm far from infallible.
 
Here's mine PCLinuxOS.

I have to drop sudo cause PCLinuxOS doesn't use sudo by default.

Code:
bash-5.1$ rpm -qi basesystem | grep "Install Date: "
Install Date: Wed 21 Aug 2019 07:07:49 PM CDT      Build Host: localhost.localdomain
bash-5.1$
 
Install Date: Wed 21 Aug 2019 07:07:49 PM CDT

I just did an install recently, so none of my desktops/laptops have very old installs.

Code:
Filesystem created:       Tue Feb 16 16:37:48 2021

Yeah, it's probably got like that after pasting it here.

One of the things I checked pretty heavily was that cut/paste of the stuff in my code tags at the site works well.

I forget the exact circumstances, but I was bitten pretty hard from cutting/pasting and there being a space in the command. The results were so bad that I just restored from backups and learned a lesson about double-checking that stuff.
 
Also, do note that the spaces are in the output, not in the command I used to get that output, so no harm can be made from that. :)
 
Also, do note that the spaces are in the output, not in the command I used to get that output, so no harm can be made from that. :)

Yeah, that makes sense. The article is cleaned up now. I've already got the next one more or less ready.
 
brian@brian-desktop:~$
brian@brian-desktop:~$ ls -lt /var/log/installer
total 568
-rw-r--r-- 1 root root 505 Aug 31 2020 telemetry
-rw-r--r-- 1 root root 48 Aug 31 2020 media-info
-rw------- 1 syslog adm 274433 Aug 31 2020 syslog
-rw------- 1 root root 274477 Aug 31 2020 partman
-rw------- 1 root root 4272 Aug 31 2020 debug
-rw------- 1 root root 30 Aug 31 2020 version
-rw------- 1 root root 2022 Aug 31 2020 casper.log
brian@brian-desktop:~$ 1
1: command not found
brian@brian-desktop:~$
brian@brian-desktop:~$ sudo tune2fs -l /dev/sda1 | grep 'Filesystem created:'
[sudo] password for brian:
tune2fs: Bad magic number in super-block while trying to open /dev/sda1
brian@brian-desktop:~$ 1
1: command not found
brian@brian-desktop:~$
brian@brian-desktop:~$ sudo tune2fs -l /dev/sda5 | grep 'Filesystem created:'
Filesystem created: Mon Mar 8 22:01:50 2021
brian@brian-desktop:~$
 
Filesystem created: Mon Mar 8 22:01:50 2021

Well, at least one of 'em works.

Where'd you install Linux? For example, it could be /dev/nvme0n1 or the likes.
 
Linux 20.1 is installed to a 120gb SSD. It shows in 'Disks' as /dev/sda5
 
I'm on Backbox Linux, which is based on Ubuntu.
ls -lt /var/log/installer
total 1272
-rw------- 1 syslog adm 523584 Feb 27 18:43 syslog
-rw-r--r-- 1 root root 501 Feb 27 18:39 telemetry
-rw-r--r-- 1 root root 42 Feb 27 18:39 media-info
-rw------- 1 root root 9426 Feb 27 18:37 debug
-rw------- 1 root root 746317 Feb 27 18:30 partman
-rw------- 1 root root 18 Feb 27 18:28 version
-rw------- 1 root root 1590 Feb 27 18:28 casper.log

sudo tune2fs -l /dev/sda4 | grep 'Filesystem created:'
Filesystem created: Sat Feb 27 18:30:24 2021
 
Linux 20.1 is installed to a 120gb SSD. It shows in 'Disks' as /dev/sda5

Weird. At least one works. In testing, prior to publishing, both worked consistently when I tried them across a few different distros. So long as one of 'em works, I'm not going to invest much time thinking about it.
 
i tried the ls -lt /var/log/installer it worked "Mint 20.1" But what does the red mean? P.S. To clarify. Why is it red?

t@t-System-Product-Name:~$ ls -lt /var/log/installer
total 872
-rw-r--r-- 1 root root 426 Apr 12 12:25 telemetry
-rw-r--r-- 1 root root 466794 Apr 12 12:25 initial-status.gz
-rw-r--r-- 1 root root 50 Apr 12 12:25 media-info
-rw------- 1 syslog adm 256751 Apr 12 12:25 syslog
-rw------- 1 root root 3102 Apr 12 12:10 debug
-rw------- 1 root root 145785 Apr 12 12:10 partman
-rw------- 1 root root 30 Apr 12 12:08 version
-rw------- 1 root root 1842 Apr 12 12:04 casper.log
 
But what does the red mean?

It could be some coloration added to the 'ls' output. That's pretty common and is from the .bashrc file (as memory serves). Different distros use different colors sometimes.

In this case, it may well be red because it's a compressed file.

You can find out by making a temp directory, adding/making a .gz file, and then using 'ls' in that directory to see if the filename is in red.

Either way, it's not something to worry about. In my case, it's orange - I think. I can't really be sure, 'cause I'm partially colorblind and have issues with that part of the spectrum.
 
Is everyone going to post the install date of their system now?
 
Maybe? I haven't. I no longer have any 'old' installs on any desktop systems.
 

Members online


Top