how to learn "when was the distro installed on this box" -- Ubuntu family
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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 ).
.....
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.
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.
"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.
"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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.