How to list all the installed package in fedora with the time of the installation

As root (or using sudo), use the yum option history.

[root@fedora ~]# yum history list
Loaded plugins: langpacks, presto, refresh-packagekit
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   250 | -y update google-chrome- | 2013-01-30 18:02 | Update         |    1 EE
   249 | -y update                | 2013-01-25 07:11 | Update         |   22   
   248 | -y update                | 2013-01-23 17:56 | Update         |   12   
   247 | -y update                | 2013-01-23 08:41 | Update         |    9 EE
   246 | -y update                | 2013-01-20 21:49 | Update         |    4   
   245 | -x kernel* update        | 2013-01-07 08:11 | Update         |    3   

You can view the packages and changes for a specific yum transaction:

[root@fedora ~]# yum history info 250
Loaded plugins: langpacks, presto, refresh-packagekit
Transaction ID : 250
Begin time     : Wed Jan 30 18:02:31 2013
Begin rpmdb    : 1624:34a60f2e27ebe4d959f1473055da42645705b96f
End time       :            18:02:59 2013 (28 seconds)
End rpmdb      : 1624:f4ef7af3a97b1f922f41803ba6b9578a7abe3e71
User           : User <user>
Return-Code    : Success
Command Line   : -y update google-chrome-stable.x86_64
Transaction performed with:
    Installed     rpm-4.9.1.3-1.fc16.x86_64               @updates
    Installed     yum-3.4.3-25.fc16.noarch                @updates
    Installed     yum-metadata-parser-1.1.4-5.fc16.x86_64 @koji-override-0/$releasever
    Installed     yum-presto-0.7.1-1.fc16.noarch          @koji-override-0/$releasever
Packages Altered:
    Updated google-chrome-stable-24.0.1312.56-177594.x86_64 @google-chrome
    Update                       24.0.1312.57-178923.x86_64 @google-chrome
Scriptlet output:
   1 Redirecting to /bin/systemctl start  atd.service

You can view the history specific packages with:

[root@fedora ~]# yum history packages-list yum
Loaded plugins: langpacks, presto, refresh-packagekit
ID     | Action(s)      | Package                                              
-------------------------------------------------------------------------------
   148 | Updated        | yum-3.4.3-24.fc16.noarch                           EE
   148 | Update         |     3.4.3-25.fc16.noarch                           EE
    94 | Updated        | yum-3.4.3-23.fc16.noarch                             
    94 | Update         |     3.4.3-24.fc16.noarch                             
    52 | Updated        | yum-3.4.3-7.fc16.noarch                              
    52 | Update         |     3.4.3-23.fc16.noarch                             
     2 | Updated        | yum-3.4.3-5.fc16.noarch                            EE
     2 | Update         |     3.4.3-7.fc16.noarch                            EE
     1 | Install        | yum-3.4.3-5.fc16.noarch                              

man 8 yum or yum help history will list more options that are possible with the history option.


I don't think that yum can do that, but rpm can:

rpm --queryformat="%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}: %{INSTALLTIME:date}\n" -qa

will produce a list of entries like:

firefox-18.0-1.fc18.x86_64: Mon 14 Jan 2013 13:47:42 GMT

I asked and answered a similar question on the Fedora Q&A site.

It turns out that Yum stores its history in an SQLite database in /var/lib/yum/history. I was able to concoct this SQL join that shows all the manually installed packages along with their installation date and times.

In my case, I was only interested in the packages I'd manually installed, so I could create a new system with similar tool to those installed on my original system.

The following command prints out every manually installed package, the transaction id, date, and yum command from history. Note that the database name will be different on your system.

$ sudo sqlite3 /var/lib/yum/history/history-2014-12-03.sqlite "select c.tid, datetime(t.timestamp, 'unixepoch'), c.cmdline from trans_cmdline as c join trans_beg as t where c.tid = t.tid"

Example output (columns: transaction id, date, command):

4|2015-02-21 20:28:03|install mutt wget emacs coreutils
5|2015-02-21 20:28:37|install firefox
6|2015-02-21 20:35:02|install pgp-tools