How can I tell what date Ubuntu was installed?











up vote
118
down vote

favorite
30












is there a command which will output the date that ubuntu (or any distribution) was installed?










share|improve this question




























    up vote
    118
    down vote

    favorite
    30












    is there a command which will output the date that ubuntu (or any distribution) was installed?










    share|improve this question


























      up vote
      118
      down vote

      favorite
      30









      up vote
      118
      down vote

      favorite
      30






      30





      is there a command which will output the date that ubuntu (or any distribution) was installed?










      share|improve this question















      is there a command which will output the date that ubuntu (or any distribution) was installed?







      command-line system-installation log






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 12 '16 at 18:32









      muru

      135k20291493




      135k20291493










      asked Aug 6 '10 at 6:09









      lxtips

      691265




      691265






















          8 Answers
          8






          active

          oldest

          votes

















          up vote
          95
          down vote













          You can check the installer logs and dates at:



          /var/log/installer


          A quick way to find the date through the command line would be by running:



          ls -lt /var/log/installer


          That lists in reverse chronological order so the oldest file is at the bottom of the list.






          share|improve this answer



















          • 1




            This file isn't on my Lucid system.
            – richq
            Aug 7 '10 at 20:31










          • On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
            – Stefan Lasiewski
            Aug 10 '10 at 0:34












          • I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
            – Marcel Stimberg
            Aug 10 '10 at 12:29










          • On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
            – JanC
            Oct 21 '10 at 3:02






          • 8




            A pastable answer might be ls -ld /var/log/installer.
            – Justin Force
            May 29 '12 at 21:45


















          up vote
          69
          down vote













          If you use ext2/ext3/ext4 and formatted the disk when you installed you can do this nifty trick.



          sudo dumpe2fs /dev/sda1 | grep 'Filesystem created:'


          You might have to change the /dev/sda1 to reflect your setup.



          Relaying on the date of files, even the "creation time" (mtime) can give errors since upgrading packages might have replaced the file and made a new "creation time".



          Similar tools and info might be available on other file systems as well, but I don't know of them.






          share|improve this answer























          • When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
            – king_julien
            Apr 2 '14 at 20:28












          • @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
            – LassePoulsen
            Apr 2 '14 at 21:36












          • Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
            – king_julien
            Apr 3 '14 at 18:36






          • 2




            You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
            – Aram Paronikyan
            Jun 8 '16 at 12:10






          • 1




            You could use the -h option so you at least only get the superblock info which should be more than enough.
            – Alexis Wilke
            Sep 25 '16 at 21:43


















          up vote
          5
          down vote













          the only command that worked for me is -



          sudo ls -alct /|tail -1|awk '{print $6, $7, $8}'





          share|improve this answer






























            up vote
            3
            down vote













            I also don't know of a specific command or file. I'm using some heuristics to find the installation date:



            for dir in {/etc,/usr,/lib}; do
            sudo find $dir -type f -exec stat -c %z {} ; |
            sed -e 's,-,,g' -e 's, .*,,' | sort | uniq -c | sort -nr -k 2 |
            grep -Ev " [0-9]?[0-9] "
            done


            This small script looks for files in /etc and /usr and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.



            This assumes that after an installation are left unchanged. This is in most cases (according to my observation) true, but in special cases it can also give wrong results.






            share|improve this answer

















            • 1




              tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
              – eik3
              Feb 28 '14 at 15:52


















            up vote
            2
            down vote













            If the installation is recent, look at the oldest entries under /var/log, but after a few weeks the logs will have been rotated away.



            Another thing to look at is the oldest ctime of a file on the root filesystem; but if the whole installation has been copied (e.g. rescued off a failing disk) at the directory tree level, this gives you the date of the copy.



            If a heuristic is good enough, look at the date (mtime) of a file that was created during the installation and is unlikely to have been modified since. A good candidate is /etc/hostname; other candidates are /etc/hosts, /etc/papersize, /etc/popularity-contest.conf.






            share|improve this answer




























              up vote
              0
              down vote













              I don't think there is.



              On Red Hat / CentOS there is the install.log files that is generated when you install the system, but this doesn't exist on Ubuntu.



              Assuming your logs go back far enough ( mine do ) you can determine the date the base installation was done in /var/log/dpkg.log*



              For example on my system the first two lines of my oldest dpkg.log file (dpkg.log.4.gz) are



              2010-04-19 11:40:55 startup archives install
              2010-04-19 11:40:55 install base-files <none> 5.0.0ubuntu18


              So I installed this system on 19/04/2010 at 11:40:55. That is correct for this system.



              There was also a brainstorm idea to add this born date.






              share|improve this answer





















              • Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                – lxtips
                Aug 6 '10 at 7:05










              • The default setup of logrotate discards dpkg logs older than one year.
                – LassePoulsen
                Aug 10 '10 at 12:13












              • @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                – Richard Holloway
                Aug 10 '10 at 17:20










              • I still think that the filesystem creation time is the best pointer se here
                – LassePoulsen
                Aug 10 '10 at 17:31


















              up vote
              0
              down vote













              would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?






              share|improve this answer




























                up vote
                -1
                down vote













                The command sudo grep ubiquity /var/log/installer/syslog | less worked for me very well.






                share|improve this answer























                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "89"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1352%2fhow-can-i-tell-what-date-ubuntu-was-installed%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  8 Answers
                  8






                  active

                  oldest

                  votes








                  8 Answers
                  8






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  up vote
                  95
                  down vote













                  You can check the installer logs and dates at:



                  /var/log/installer


                  A quick way to find the date through the command line would be by running:



                  ls -lt /var/log/installer


                  That lists in reverse chronological order so the oldest file is at the bottom of the list.






                  share|improve this answer



















                  • 1




                    This file isn't on my Lucid system.
                    – richq
                    Aug 7 '10 at 20:31










                  • On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
                    – Stefan Lasiewski
                    Aug 10 '10 at 0:34












                  • I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
                    – Marcel Stimberg
                    Aug 10 '10 at 12:29










                  • On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
                    – JanC
                    Oct 21 '10 at 3:02






                  • 8




                    A pastable answer might be ls -ld /var/log/installer.
                    – Justin Force
                    May 29 '12 at 21:45















                  up vote
                  95
                  down vote













                  You can check the installer logs and dates at:



                  /var/log/installer


                  A quick way to find the date through the command line would be by running:



                  ls -lt /var/log/installer


                  That lists in reverse chronological order so the oldest file is at the bottom of the list.






                  share|improve this answer



















                  • 1




                    This file isn't on my Lucid system.
                    – richq
                    Aug 7 '10 at 20:31










                  • On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
                    – Stefan Lasiewski
                    Aug 10 '10 at 0:34












                  • I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
                    – Marcel Stimberg
                    Aug 10 '10 at 12:29










                  • On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
                    – JanC
                    Oct 21 '10 at 3:02






                  • 8




                    A pastable answer might be ls -ld /var/log/installer.
                    – Justin Force
                    May 29 '12 at 21:45













                  up vote
                  95
                  down vote










                  up vote
                  95
                  down vote









                  You can check the installer logs and dates at:



                  /var/log/installer


                  A quick way to find the date through the command line would be by running:



                  ls -lt /var/log/installer


                  That lists in reverse chronological order so the oldest file is at the bottom of the list.






                  share|improve this answer














                  You can check the installer logs and dates at:



                  /var/log/installer


                  A quick way to find the date through the command line would be by running:



                  ls -lt /var/log/installer


                  That lists in reverse chronological order so the oldest file is at the bottom of the list.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 6 '17 at 23:03









                  H2ONaCl

                  3,245204885




                  3,245204885










                  answered Aug 6 '10 at 7:28









                  João Pinto

                  14.6k34660




                  14.6k34660








                  • 1




                    This file isn't on my Lucid system.
                    – richq
                    Aug 7 '10 at 20:31










                  • On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
                    – Stefan Lasiewski
                    Aug 10 '10 at 0:34












                  • I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
                    – Marcel Stimberg
                    Aug 10 '10 at 12:29










                  • On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
                    – JanC
                    Oct 21 '10 at 3:02






                  • 8




                    A pastable answer might be ls -ld /var/log/installer.
                    – Justin Force
                    May 29 '12 at 21:45














                  • 1




                    This file isn't on my Lucid system.
                    – richq
                    Aug 7 '10 at 20:31










                  • On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
                    – Stefan Lasiewski
                    Aug 10 '10 at 0:34












                  • I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
                    – Marcel Stimberg
                    Aug 10 '10 at 12:29










                  • On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
                    – JanC
                    Oct 21 '10 at 3:02






                  • 8




                    A pastable answer might be ls -ld /var/log/installer.
                    – Justin Force
                    May 29 '12 at 21:45








                  1




                  1




                  This file isn't on my Lucid system.
                  – richq
                  Aug 7 '10 at 20:31




                  This file isn't on my Lucid system.
                  – richq
                  Aug 7 '10 at 20:31












                  On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
                  – Stefan Lasiewski
                  Aug 10 '10 at 0:34






                  On my system, I have 7 files under /var/log/installer/ . I installed from 9.10, and later updated to 10.04.
                  – Stefan Lasiewski
                  Aug 10 '10 at 0:34














                  I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
                  – Marcel Stimberg
                  Aug 10 '10 at 12:29




                  I do also have this folder on my (freshly installed) 10.04 system and the creation dates of those files give me the install date. The file /var/log/installer/media-info for example contains the information about the installation media that was used for the install.
                  – Marcel Stimberg
                  Aug 10 '10 at 12:29












                  On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
                  – JanC
                  Oct 21 '10 at 3:02




                  On my system that was installed originally with 7.10, /var/log/installer/version has a date of 2007-10-30, so this seems to be quite reliable...
                  – JanC
                  Oct 21 '10 at 3:02




                  8




                  8




                  A pastable answer might be ls -ld /var/log/installer.
                  – Justin Force
                  May 29 '12 at 21:45




                  A pastable answer might be ls -ld /var/log/installer.
                  – Justin Force
                  May 29 '12 at 21:45












                  up vote
                  69
                  down vote













                  If you use ext2/ext3/ext4 and formatted the disk when you installed you can do this nifty trick.



                  sudo dumpe2fs /dev/sda1 | grep 'Filesystem created:'


                  You might have to change the /dev/sda1 to reflect your setup.



                  Relaying on the date of files, even the "creation time" (mtime) can give errors since upgrading packages might have replaced the file and made a new "creation time".



                  Similar tools and info might be available on other file systems as well, but I don't know of them.






                  share|improve this answer























                  • When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
                    – king_julien
                    Apr 2 '14 at 20:28












                  • @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
                    – LassePoulsen
                    Apr 2 '14 at 21:36












                  • Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
                    – king_julien
                    Apr 3 '14 at 18:36






                  • 2




                    You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
                    – Aram Paronikyan
                    Jun 8 '16 at 12:10






                  • 1




                    You could use the -h option so you at least only get the superblock info which should be more than enough.
                    – Alexis Wilke
                    Sep 25 '16 at 21:43















                  up vote
                  69
                  down vote













                  If you use ext2/ext3/ext4 and formatted the disk when you installed you can do this nifty trick.



                  sudo dumpe2fs /dev/sda1 | grep 'Filesystem created:'


                  You might have to change the /dev/sda1 to reflect your setup.



                  Relaying on the date of files, even the "creation time" (mtime) can give errors since upgrading packages might have replaced the file and made a new "creation time".



                  Similar tools and info might be available on other file systems as well, but I don't know of them.






                  share|improve this answer























                  • When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
                    – king_julien
                    Apr 2 '14 at 20:28












                  • @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
                    – LassePoulsen
                    Apr 2 '14 at 21:36












                  • Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
                    – king_julien
                    Apr 3 '14 at 18:36






                  • 2




                    You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
                    – Aram Paronikyan
                    Jun 8 '16 at 12:10






                  • 1




                    You could use the -h option so you at least only get the superblock info which should be more than enough.
                    – Alexis Wilke
                    Sep 25 '16 at 21:43













                  up vote
                  69
                  down vote










                  up vote
                  69
                  down vote









                  If you use ext2/ext3/ext4 and formatted the disk when you installed you can do this nifty trick.



                  sudo dumpe2fs /dev/sda1 | grep 'Filesystem created:'


                  You might have to change the /dev/sda1 to reflect your setup.



                  Relaying on the date of files, even the "creation time" (mtime) can give errors since upgrading packages might have replaced the file and made a new "creation time".



                  Similar tools and info might be available on other file systems as well, but I don't know of them.






                  share|improve this answer














                  If you use ext2/ext3/ext4 and formatted the disk when you installed you can do this nifty trick.



                  sudo dumpe2fs /dev/sda1 | grep 'Filesystem created:'


                  You might have to change the /dev/sda1 to reflect your setup.



                  Relaying on the date of files, even the "creation time" (mtime) can give errors since upgrading packages might have replaced the file and made a new "creation time".



                  Similar tools and info might be available on other file systems as well, but I don't know of them.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 13 '14 at 0:33

























                  answered Aug 10 '10 at 12:11









                  LassePoulsen

                  11.5k83857




                  11.5k83857












                  • When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
                    – king_julien
                    Apr 2 '14 at 20:28












                  • @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
                    – LassePoulsen
                    Apr 2 '14 at 21:36












                  • Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
                    – king_julien
                    Apr 3 '14 at 18:36






                  • 2




                    You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
                    – Aram Paronikyan
                    Jun 8 '16 at 12:10






                  • 1




                    You could use the -h option so you at least only get the superblock info which should be more than enough.
                    – Alexis Wilke
                    Sep 25 '16 at 21:43


















                  • When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
                    – king_julien
                    Apr 2 '14 at 20:28












                  • @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
                    – LassePoulsen
                    Apr 2 '14 at 21:36












                  • Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
                    – king_julien
                    Apr 3 '14 at 18:36






                  • 2




                    You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
                    – Aram Paronikyan
                    Jun 8 '16 at 12:10






                  • 1




                    You could use the -h option so you at least only get the superblock info which should be more than enough.
                    – Alexis Wilke
                    Sep 25 '16 at 21:43
















                  When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
                  – king_julien
                  Apr 2 '14 at 20:28






                  When I do this I get the error dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
                  – king_julien
                  Apr 2 '14 at 20:28














                  @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
                  – LassePoulsen
                  Apr 2 '14 at 21:36






                  @king_julien Are you sure that your /dev/sda1 is your systems root partition? It may be different on your install, in fact the filesystem type may be an other than what is supported by dumpe2fs!
                  – LassePoulsen
                  Apr 2 '14 at 21:36














                  Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
                  – king_julien
                  Apr 3 '14 at 18:36




                  Thanks, I got it now. It was /dev/sda2. On /dev/sda1 I have /boot/efi.
                  – king_julien
                  Apr 3 '14 at 18:36




                  2




                  2




                  You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
                  – Aram Paronikyan
                  Jun 8 '16 at 12:10




                  You can use a more general but a little complicated command: sudo dumpe2fs $(mount | grep 'on / ' | awk '{print $1}') | grep 'Filesystem created:'
                  – Aram Paronikyan
                  Jun 8 '16 at 12:10




                  1




                  1




                  You could use the -h option so you at least only get the superblock info which should be more than enough.
                  – Alexis Wilke
                  Sep 25 '16 at 21:43




                  You could use the -h option so you at least only get the superblock info which should be more than enough.
                  – Alexis Wilke
                  Sep 25 '16 at 21:43










                  up vote
                  5
                  down vote













                  the only command that worked for me is -



                  sudo ls -alct /|tail -1|awk '{print $6, $7, $8}'





                  share|improve this answer



























                    up vote
                    5
                    down vote













                    the only command that worked for me is -



                    sudo ls -alct /|tail -1|awk '{print $6, $7, $8}'





                    share|improve this answer

























                      up vote
                      5
                      down vote










                      up vote
                      5
                      down vote









                      the only command that worked for me is -



                      sudo ls -alct /|tail -1|awk '{print $6, $7, $8}'





                      share|improve this answer














                      the only command that worked for me is -



                      sudo ls -alct /|tail -1|awk '{print $6, $7, $8}'






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Aug 22 '16 at 14:44









                      Tim

                      19.5k1484139




                      19.5k1484139










                      answered Feb 11 '16 at 12:10









                      Tony Doyle

                      6112




                      6112






















                          up vote
                          3
                          down vote













                          I also don't know of a specific command or file. I'm using some heuristics to find the installation date:



                          for dir in {/etc,/usr,/lib}; do
                          sudo find $dir -type f -exec stat -c %z {} ; |
                          sed -e 's,-,,g' -e 's, .*,,' | sort | uniq -c | sort -nr -k 2 |
                          grep -Ev " [0-9]?[0-9] "
                          done


                          This small script looks for files in /etc and /usr and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.



                          This assumes that after an installation are left unchanged. This is in most cases (according to my observation) true, but in special cases it can also give wrong results.






                          share|improve this answer

















                          • 1




                            tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
                            – eik3
                            Feb 28 '14 at 15:52















                          up vote
                          3
                          down vote













                          I also don't know of a specific command or file. I'm using some heuristics to find the installation date:



                          for dir in {/etc,/usr,/lib}; do
                          sudo find $dir -type f -exec stat -c %z {} ; |
                          sed -e 's,-,,g' -e 's, .*,,' | sort | uniq -c | sort -nr -k 2 |
                          grep -Ev " [0-9]?[0-9] "
                          done


                          This small script looks for files in /etc and /usr and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.



                          This assumes that after an installation are left unchanged. This is in most cases (according to my observation) true, but in special cases it can also give wrong results.






                          share|improve this answer

















                          • 1




                            tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
                            – eik3
                            Feb 28 '14 at 15:52













                          up vote
                          3
                          down vote










                          up vote
                          3
                          down vote









                          I also don't know of a specific command or file. I'm using some heuristics to find the installation date:



                          for dir in {/etc,/usr,/lib}; do
                          sudo find $dir -type f -exec stat -c %z {} ; |
                          sed -e 's,-,,g' -e 's, .*,,' | sort | uniq -c | sort -nr -k 2 |
                          grep -Ev " [0-9]?[0-9] "
                          done


                          This small script looks for files in /etc and /usr and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.



                          This assumes that after an installation are left unchanged. This is in most cases (according to my observation) true, but in special cases it can also give wrong results.






                          share|improve this answer












                          I also don't know of a specific command or file. I'm using some heuristics to find the installation date:



                          for dir in {/etc,/usr,/lib}; do
                          sudo find $dir -type f -exec stat -c %z {} ; |
                          sed -e 's,-,,g' -e 's, .*,,' | sort | uniq -c | sort -nr -k 2 |
                          grep -Ev " [0-9]?[0-9] "
                          done


                          This small script looks for files in /etc and /usr and prints out the last changed date. It does some reformatting and lists the occurrences sorted by date (newest first). Usually the oldest entry is the installation date.



                          This assumes that after an installation are left unchanged. This is in most cases (according to my observation) true, but in special cases it can also give wrong results.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 6 '10 at 7:49









                          qbi

                          14.9k863118




                          14.9k863118








                          • 1




                            tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
                            – eik3
                            Feb 28 '14 at 15:52














                          • 1




                            tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
                            – eik3
                            Feb 28 '14 at 15:52








                          1




                          1




                          tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
                          – eik3
                          Feb 28 '14 at 15:52




                          tried it on /etc only (faster), the date was the same as from the dumpe2fs solution, so for me it worked well!
                          – eik3
                          Feb 28 '14 at 15:52










                          up vote
                          2
                          down vote













                          If the installation is recent, look at the oldest entries under /var/log, but after a few weeks the logs will have been rotated away.



                          Another thing to look at is the oldest ctime of a file on the root filesystem; but if the whole installation has been copied (e.g. rescued off a failing disk) at the directory tree level, this gives you the date of the copy.



                          If a heuristic is good enough, look at the date (mtime) of a file that was created during the installation and is unlikely to have been modified since. A good candidate is /etc/hostname; other candidates are /etc/hosts, /etc/papersize, /etc/popularity-contest.conf.






                          share|improve this answer

























                            up vote
                            2
                            down vote













                            If the installation is recent, look at the oldest entries under /var/log, but after a few weeks the logs will have been rotated away.



                            Another thing to look at is the oldest ctime of a file on the root filesystem; but if the whole installation has been copied (e.g. rescued off a failing disk) at the directory tree level, this gives you the date of the copy.



                            If a heuristic is good enough, look at the date (mtime) of a file that was created during the installation and is unlikely to have been modified since. A good candidate is /etc/hostname; other candidates are /etc/hosts, /etc/papersize, /etc/popularity-contest.conf.






                            share|improve this answer























                              up vote
                              2
                              down vote










                              up vote
                              2
                              down vote









                              If the installation is recent, look at the oldest entries under /var/log, but after a few weeks the logs will have been rotated away.



                              Another thing to look at is the oldest ctime of a file on the root filesystem; but if the whole installation has been copied (e.g. rescued off a failing disk) at the directory tree level, this gives you the date of the copy.



                              If a heuristic is good enough, look at the date (mtime) of a file that was created during the installation and is unlikely to have been modified since. A good candidate is /etc/hostname; other candidates are /etc/hosts, /etc/papersize, /etc/popularity-contest.conf.






                              share|improve this answer












                              If the installation is recent, look at the oldest entries under /var/log, but after a few weeks the logs will have been rotated away.



                              Another thing to look at is the oldest ctime of a file on the root filesystem; but if the whole installation has been copied (e.g. rescued off a failing disk) at the directory tree level, this gives you the date of the copy.



                              If a heuristic is good enough, look at the date (mtime) of a file that was created during the installation and is unlikely to have been modified since. A good candidate is /etc/hostname; other candidates are /etc/hosts, /etc/papersize, /etc/popularity-contest.conf.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Aug 10 '10 at 11:54









                              Gilles

                              44.4k1399138




                              44.4k1399138






















                                  up vote
                                  0
                                  down vote













                                  I don't think there is.



                                  On Red Hat / CentOS there is the install.log files that is generated when you install the system, but this doesn't exist on Ubuntu.



                                  Assuming your logs go back far enough ( mine do ) you can determine the date the base installation was done in /var/log/dpkg.log*



                                  For example on my system the first two lines of my oldest dpkg.log file (dpkg.log.4.gz) are



                                  2010-04-19 11:40:55 startup archives install
                                  2010-04-19 11:40:55 install base-files <none> 5.0.0ubuntu18


                                  So I installed this system on 19/04/2010 at 11:40:55. That is correct for this system.



                                  There was also a brainstorm idea to add this born date.






                                  share|improve this answer





















                                  • Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                                    – lxtips
                                    Aug 6 '10 at 7:05










                                  • The default setup of logrotate discards dpkg logs older than one year.
                                    – LassePoulsen
                                    Aug 10 '10 at 12:13












                                  • @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                                    – Richard Holloway
                                    Aug 10 '10 at 17:20










                                  • I still think that the filesystem creation time is the best pointer se here
                                    – LassePoulsen
                                    Aug 10 '10 at 17:31















                                  up vote
                                  0
                                  down vote













                                  I don't think there is.



                                  On Red Hat / CentOS there is the install.log files that is generated when you install the system, but this doesn't exist on Ubuntu.



                                  Assuming your logs go back far enough ( mine do ) you can determine the date the base installation was done in /var/log/dpkg.log*



                                  For example on my system the first two lines of my oldest dpkg.log file (dpkg.log.4.gz) are



                                  2010-04-19 11:40:55 startup archives install
                                  2010-04-19 11:40:55 install base-files <none> 5.0.0ubuntu18


                                  So I installed this system on 19/04/2010 at 11:40:55. That is correct for this system.



                                  There was also a brainstorm idea to add this born date.






                                  share|improve this answer





















                                  • Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                                    – lxtips
                                    Aug 6 '10 at 7:05










                                  • The default setup of logrotate discards dpkg logs older than one year.
                                    – LassePoulsen
                                    Aug 10 '10 at 12:13












                                  • @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                                    – Richard Holloway
                                    Aug 10 '10 at 17:20










                                  • I still think that the filesystem creation time is the best pointer se here
                                    – LassePoulsen
                                    Aug 10 '10 at 17:31













                                  up vote
                                  0
                                  down vote










                                  up vote
                                  0
                                  down vote









                                  I don't think there is.



                                  On Red Hat / CentOS there is the install.log files that is generated when you install the system, but this doesn't exist on Ubuntu.



                                  Assuming your logs go back far enough ( mine do ) you can determine the date the base installation was done in /var/log/dpkg.log*



                                  For example on my system the first two lines of my oldest dpkg.log file (dpkg.log.4.gz) are



                                  2010-04-19 11:40:55 startup archives install
                                  2010-04-19 11:40:55 install base-files <none> 5.0.0ubuntu18


                                  So I installed this system on 19/04/2010 at 11:40:55. That is correct for this system.



                                  There was also a brainstorm idea to add this born date.






                                  share|improve this answer












                                  I don't think there is.



                                  On Red Hat / CentOS there is the install.log files that is generated when you install the system, but this doesn't exist on Ubuntu.



                                  Assuming your logs go back far enough ( mine do ) you can determine the date the base installation was done in /var/log/dpkg.log*



                                  For example on my system the first two lines of my oldest dpkg.log file (dpkg.log.4.gz) are



                                  2010-04-19 11:40:55 startup archives install
                                  2010-04-19 11:40:55 install base-files <none> 5.0.0ubuntu18


                                  So I installed this system on 19/04/2010 at 11:40:55. That is correct for this system.



                                  There was also a brainstorm idea to add this born date.







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Aug 6 '10 at 6:19









                                  Richard Holloway

                                  20.2k54152




                                  20.2k54152












                                  • Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                                    – lxtips
                                    Aug 6 '10 at 7:05










                                  • The default setup of logrotate discards dpkg logs older than one year.
                                    – LassePoulsen
                                    Aug 10 '10 at 12:13












                                  • @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                                    – Richard Holloway
                                    Aug 10 '10 at 17:20










                                  • I still think that the filesystem creation time is the best pointer se here
                                    – LassePoulsen
                                    Aug 10 '10 at 17:31


















                                  • Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                                    – lxtips
                                    Aug 6 '10 at 7:05










                                  • The default setup of logrotate discards dpkg logs older than one year.
                                    – LassePoulsen
                                    Aug 10 '10 at 12:13












                                  • @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                                    – Richard Holloway
                                    Aug 10 '10 at 17:20










                                  • I still think that the filesystem creation time is the best pointer se here
                                    – LassePoulsen
                                    Aug 10 '10 at 17:31
















                                  Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                                  – lxtips
                                  Aug 6 '10 at 7:05




                                  Thank-you andol, thank-you Richard. /var/log/dpkg.log.1 on a lucid desktop system gave a correct answer where as /var/log/dpkg.log was the only file on a lucid server setup I have, so a little detective work was needed. Some further understanding of the log files will be helpful.
                                  – lxtips
                                  Aug 6 '10 at 7:05












                                  The default setup of logrotate discards dpkg logs older than one year.
                                  – LassePoulsen
                                  Aug 10 '10 at 12:13






                                  The default setup of logrotate discards dpkg logs older than one year.
                                  – LassePoulsen
                                  Aug 10 '10 at 12:13














                                  @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                                  – Richard Holloway
                                  Aug 10 '10 at 17:20




                                  @Source Lab : Yup. My answer is not foolproof. I did not know about the /var/log/installer directory but do now. That is a better solution.
                                  – Richard Holloway
                                  Aug 10 '10 at 17:20












                                  I still think that the filesystem creation time is the best pointer se here
                                  – LassePoulsen
                                  Aug 10 '10 at 17:31




                                  I still think that the filesystem creation time is the best pointer se here
                                  – LassePoulsen
                                  Aug 10 '10 at 17:31










                                  up vote
                                  0
                                  down vote













                                  would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?






                                  share|improve this answer

























                                    up vote
                                    0
                                    down vote













                                    would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?






                                    share|improve this answer























                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote









                                      would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?






                                      share|improve this answer












                                      would it be simple (i may be wrong) just to check software centre, while in there click on 'history' and scroll down to the bottom of your installed updates. Mine shows april 23 2012 first installation. Which is about right when I started using ubuntu?







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jan 10 '14 at 11:49









                                      maple6661

                                      61




                                      61






















                                          up vote
                                          -1
                                          down vote













                                          The command sudo grep ubiquity /var/log/installer/syslog | less worked for me very well.






                                          share|improve this answer



























                                            up vote
                                            -1
                                            down vote













                                            The command sudo grep ubiquity /var/log/installer/syslog | less worked for me very well.






                                            share|improve this answer

























                                              up vote
                                              -1
                                              down vote










                                              up vote
                                              -1
                                              down vote









                                              The command sudo grep ubiquity /var/log/installer/syslog | less worked for me very well.






                                              share|improve this answer














                                              The command sudo grep ubiquity /var/log/installer/syslog | less worked for me very well.







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Aug 21 '12 at 19:26









                                              Eliah Kagan

                                              81.1k20227364




                                              81.1k20227364










                                              answered Feb 9 '11 at 16:04









                                              Bakhtiyor

                                              4,339185676




                                              4,339185676






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Ask Ubuntu!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.





                                                  Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                  Please pay close attention to the following guidance:


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1352%2fhow-can-i-tell-what-date-ubuntu-was-installed%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  數位音樂下載

                                                  When can things happen in Etherscan, such as the picture below?

                                                  格利澤436b