54

I'm on a CentOS machine. I updated and installed some packages a few weeks back, but I don't remember the name of every package or the names of every dependency. I used yum.

Can I list the packages on my system by the date they were last installed or updated?

Stefan Lasiewski
  • 19,264
  • 24
  • 70
  • 85
  • This question (and the solutions) is probably generic to all RPM based Linux distros like Fedora, RHEL, CENTOS, and so on. I say probably just to be on the safe side. – Trevor Boyd Smith Jan 21 '19 at 14:07

3 Answers3

74

To list all packages and their install dates, latest first:

rpm -qa --last
mwfearnley
  • 1,104
  • 1
  • 16
  • 19
peonicles
  • 928
  • 7
  • 6
  • or the most recent 20 items which also show which sub version of RHEL (eg., 8.7.3): `rpm -qa --last | grep -E el8_[[:digit:]].[[:digit:]] | head -20` – nickboldt Apr 19 '23 at 19:01
26

This should work on any RPM based machine:

rpm -qa --qf '%{INSTALLTIME} (%{INSTALLTIME:date}): %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -n

(To get a list of all possible tags, use rpm --querytags.)

bhm
  • 751
  • 4
  • 5
0

You might like the latest last:

rpm -qa --last | tac
caot
  • 101
  • 1