Find the Linux system install date
Find when a Linux system was installed, using the filesystem creation date, rpm, pacman or emerge.
Linux does not store the system install date in a single fixed place. Depending on the distribution, you can find it in the package manager history, in the install date of a base package, or from the creation date of the filesystem.
Filesystem creation date
For an ext2, ext3 or ext4 filesystem, tune2fs and dumpe2fs show the creation date:
sudo tune2fs -l /dev/mapper/vg_root-lv_root | grep 'create'
sudo dumpe2fs /dev/sda1 | grep 'Filesystem created:'
Replace the devices with the one that holds the root filesystem (df / shows it).
With stat, the birth time of the root directory is available if the filesystem records it:
stat / | grep Birth
Package install date
On RPM-based distributions (Red Hat, Fedora, CentOS):
sudo rpm -qi basesystem | grep Install
sudo rpm -q basesystem --qf '%{installtime:date}\n'
On Arch Linux, the first line of the pacman log contains the date of the first transaction:
head -n 1 /var/log/pacman.log
On Gentoo, the first line of the emerge log plays the same role:
head -n 1 /var/log/emerge.log
Notes
- The filesystem creation date can be later than the real installation, for example after a restore or an image copy.
- The pacman and emerge logs may have been rotated or purged, so the first line is not necessarily the installation.