LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-17-2010, 03:39 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
how to learn "when was the distro installed on this box" -- Ubuntu family


So I spin the media and "fresh install" Ubuntu Jaunty onto my laptop.
... time passes ...
Now I want to discover the date that I accomplished that install.
Only the Lord knows what I've added changed or deleted since then
and He's not telling me.

Somewhere on this laptop is a file or similar that I might view
that will tell me when I spun the distro installer. Preferably, I
want a resource I might inspect with 'find' or 'tar' or 'make' or
some scriptable date testing.

The file /etc/lsb-release reports the distro details but not the install date.

SUGGESTION: Add the install date to the specification of this file's contents.

Code:
user@host:/path/ $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"
user@host:/path/ $
File system creation dates are not definitive -- I might be re-using
an existing partition even if I do a fresh install.

Q1: Can someone tell me where to look?

~~~ 0;-Dan

Last edited by SaintDanBert; 06-17-2010 at 03:40 PM.
 
Old 06-17-2010, 03:58 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
May be a good idea to do this command at install time :
dpkg --get-selections > install$time`date '+%Y-%m-%d-%T'`


Later, when one or more extra packages are installed :
ls -tl /var/lib/dpkg/info/ | grep list > last-packages
( $time`date '+%Y-%m-%d'` can be added too ).
.....
 
Old 06-17-2010, 04:02 PM   #3
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
You would probably get better response adding that suggestion to the ubuntu site... not that it's really a tremendously relevant or significant piece of information.

You could check the sources.list file in your /etc/apt directory if you've never made modifications to it or creation dates on files/directories in less used areas of the file systems to get some idea, but that's going to be a pretty hard number to pin down directly. A simple "date >> /etc/initial.installation" would probably be sufficient for future installs if thats something you feel you need to know.
 
Old 06-17-2010, 04:03 PM   #4
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
If you haven't recompiled your kernel, this command will give you the kernel build date/time:

Code:
uname -v
 
Old 06-17-2010, 05:20 PM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Lots of ideas about what to do ...
(grin) ... if you think about it in advance.
I didn't think about it in advance.

Now I have this system and am trying to do archeology (or maybe forensics).

What I do know goes like this:
1. mount shows details about the '/' file system
Code:
user@host:/path $ mount

/dev/sda6 on / type ext3 (rw,relatime,errors=remount-ro)
2. tune2fs diggs deeper into the details for the file system
Code:
user@host:/path $ sudo tune2fs -l /dev/sda6 | grep -i created

Filesystem created:       Wed Feb 24 17:26:41 2010
3. There are config files in the /etc folder
Code:
user@host:/path/ $ ls -ltrh /etc | grep -i "2010-02-24"

lrwxrwxrwx  1 root root     13 2010-02-24 17:30 motd -> /var/run/motd
-rw-r--r--  1 root root    253 2010-02-24 17:40 hosts
-rw-r--r--  1 root root      8 2010-02-24 17:40 hostname
drwxr-xr-x  2 root root   4.0K 2010-02-24 17:42 console-setup
-rw-r--r--  1 root root    117 2010-02-24 17:42 usplash.conf
-rw-r--r--  1 root root      7 2010-02-24 17:42 papersize
-rw-r--r--  1 root root    167 2010-02-24 17:43 kernel-img.conf
drwxr-xr-x  2 root root   4.0K 2010-02-24 17:53 dictionaries-common
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:35 security
drwxr-xr-x  4 root root   4.0K 2010-02-24 19:38 dhcp3
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:38 cron.weekly
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:38 cron.monthly
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:38 cron.hourly
drwxr-xr-x  3 root root   4.0K 2010-02-24 19:38 update-manager
drwxr-xr-x  3 root root   4.0K 2010-02-24 19:38 udev
-rw-r--r--  1 root root    198 2010-02-24 19:38 modules
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:38 gnome-app-install
drwxr-xr-x  3 root root   4.0K 2010-02-24 19:39 apport
drwxr-xr-x  3 root root   4.0K 2010-02-24 19:39 sgml
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:39 profile.d
drwxr-xr-x  4 root root   4.0K 2010-02-24 19:39 mono
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:39 purple
drwxr-xr-x  4 root root   4.0K 2010-02-24 19:39 ssl
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:39 pulse
drwxr-xr-x  5 root root   4.0K 2010-02-24 19:40 dbus-1
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:40 bluetooth
drwxr-xr-x  2 root root   4.0K 2010-02-24 19:40 checkbox.d
-rw-------  1 root saint     0 2010-02-24 19:41 mtab.fuselock
drwxr-xr-x  2 root root   4.0K 2010-02-24 20:02 gromit
drwxr-xr-x  3 root root   4.0K 2010-02-24 20:15 emacs22
drwxr-xr-x  3 root root   4.0K 2010-02-24 20:15 emacs
drwxr-xr-x  2 root root   4.0K 2010-02-24 20:15 dictd
drwxr-xr-x  2 root root   4.0K 2010-02-24 20:39 python2.5
drwxr-xr-x  2 root root   4.0K 2010-02-24 20:40 timidity
drwxr-xr-x  2 root root   4.0K 2010-02-24 20:40 wildmidi
-rw-r--r--  1 root root   1.4K 2010-02-24 21:01 fstab~
-rw-r--r--  1 root root   1.4K 2010-02-24 21:04 fstab
drwxr-xr-x  2 root root   4.0K 2010-02-24 23:15 synce
One candidate would be to use the output of tune2fs directly. It presents a clean date string. This presumes that you created the root file system during the install. I always do, but others might have different experiences.

Another candidates include /etc/kernel-img.conf. Does anyone know when and why this file might get altered?

Yet another candidate is /etc/hostname if one picks
a host name during install and never changes it. Does anyone know
when and why this might get altered?

When I ask about alterations, I'm not speaking of end-user modifications. Instead I speak of side effects of package updates or other mostly invisible, auto-magic system administration. If the operator nut twists a wrench, all other bets are off.

~~~ 0;-Dan

Last edited by SaintDanBert; 06-17-2010 at 05:21 PM.
 
Old 06-22-2010, 10:18 AM   #6
genenj
LQ Newbie
 
Registered: Oct 2009
Location: NJ
Distribution: Ubuntu 9.04
Posts: 3

Rep: Reputation: 0
I am no expert so please forgive me if this is foolish...

I know Ubuntu has a /var/log/installer directory (I don't know about other distros).

I suggest looking in the /var/log/installer directory.

There are a number of files created (timestamped) during the installation.

Just a suggestion.

genenj
 
Old 06-22-2010, 02:27 PM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Some things just aren't 100% "provable":

"I have seen 10,000 ravens. They were all black. Therefore all ravens are black."
Likely, and possible, but not proven.

"I have examined all ravens that exist. They were all black. Therefore all ravens are black."
Highly likely, but still unproven. Maybe an albino raven hatched two minutes ago.

"Ravens are defined as birds that are ..., .., and coloured black". "All ravens are black".
Correct, but not very helpful, apart from "here's the definition of a raven, it must be black, so if it's not black it's not a raven by definition".

You could search your entire filesystem, and find the 200 oldest file creation times. When I refer to "time" this refers both to the date and the time on that date. [ See find and ctime ]

That would probably be the installation time, especially if you found "oldest" files with creation times differing by only minutes or seconds. This evidence could be reinforced if you could show that the installer used by that distro, at that time, created files in a certain order, and the creation times of different files match the installers file-creation procedure.

This could be manipulated, but not very easily.

[I like forensics]

HTH
 
Old 06-22-2010, 03:27 PM   #8
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by tredegar View Post
Some things just aren't 100% "provable":

"I have seen 10,000 ravens. They were all black. Therefore all ravens are black."
Likely, and possible, but not proven.
...
[I like forensics]

HTH
I like ravens ... "Squawk! Nevermore."

Any file may have its datetimestamp tinkered in various ways.
That is why I say they are problematic. Even if there were a smoking
gun text string somewhere, that, too, is easy to edit.

I'm hoping that there is a standard issue date-installed marker somewhere. I have yet to check out the file://var/log/installer mentioned elsewhere in this thread.

~~~ 0;-Dan
 
Old 06-22-2010, 04:18 PM   #9
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 69
Quote:
2. tune2fs diggs deeper into the details for the file system
Code:

user@host:/path $ sudo tune2fs -l /dev/sda6 | grep -i created

Filesystem created: Wed Feb 24 17:26:41 2010
Maybe I'm missing something, but doesn't this info tell you when the system was installed (by pinpointing when the FS was created)?
 
Old 06-22-2010, 04:20 PM   #10
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I have yet to check out the file://var/log/installer
"No such file".

If you think about it, there really isn't any good reason to record when a system was installed.

All that really matters is the version numbers of the software that are available / running.

May I ask why you are asking this question?
 
Old 06-23-2010, 09:57 AM   #11
genenj
LQ Newbie
 
Registered: Oct 2009
Location: NJ
Distribution: Ubuntu 9.04
Posts: 3

Rep: Reputation: 0
My /var/log/installer directory has the files:
initial-status.gz
partman
syslog
hardware-summary
lsb-release
status

As well as another directory called cdebconf.

I don't really need to know when my machine was installed, I have only consulted the syslog file when I was debugging a preseed file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wicd in Ubuntu Intrepid - I uncheck the "Use static IP" box, but it tries anyway! bela214 Linux - Software 6 05-04-2010 05:45 PM
Tried and true FC-8 installed on new(er) intel box; can't get past "Starting UDev" LateNighter Linux - General 10 03-27-2010 06:31 PM
how to run exe files like"VLC"in ubuntu while it's installed in windows krishnadas Linux - Newbie 2 09-25-2009 03:51 PM
will this command mount my old "/home" for a new distro installed? mhg Linux - Newbie 4 07-01-2007 02:00 PM
just finish installed "crossover office" want to install kazaa just for learn .. how? SlackwareMan Linux - Software 3 08-06-2004 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration