41

How can I get a list of packages, that last installed / upgraded by pacman / yaourt in Arch Linux including the timestamp?

2 Answers 2

68

To get a list of last installed packages, you can run:

grep -i installed /var/log/pacman.log

Example output of last installed packages:

[2015-08-24 15:32] [ALPM] warning: /etc/pamac.conf installed as /etc/pamac.conf.pacnew
[2015-08-24 15:32] [ALPM] installed python-packaging (15.3-1)
[2015-08-24 15:32] [ALPM] installed python2-packaging (15.3-1)
[2015-08-25 10:37] [ALPM] installed ttf-ubuntu-font-family (0.80-5)
[2015-08-25 10:43] [ALPM] installed ttf-google-fonts (20150805.r201-1)
[2015-08-25 10:44] [ALPM] installed ttf-ubuntu-font-family (0.80-5)
[2015-08-26 17:39] [ALPM] installed mozilla-extension-gnome-keyring-git (0.10.r36.378d9f3-1)

To get a list of last upgraded packages, you can run:

grep -i upgraded /var/log/pacman.log

Example output of last upgraded packages:

[2015-08-27 10:00] [ALPM] upgraded libinput (0.99.1-1 -> 1.0.0-1)
[2015-08-27 10:00] [ALPM] upgraded python2-mako (1.0.1-1 -> 1.0.2-1)
[2015-08-27 16:03] [ALPM] upgraded tdb (1.3.6-1 -> 1.3.7-1)
[2015-08-27 16:03] [ALPM] upgraded ldb (1.1.20-1 -> 1.1.21-1)
[2015-08-27 16:03] [ALPM] upgraded python2-mako (1.0.2-1 -> 1.0.2-2)

To get a list of last installed or upgraded packages, you can run:

grep -iE 'installed|upgraded' /var/log/pacman.log

Example output of last upgraded packages:

[2015-08-25 09:56] [ALPM] upgraded jdk (8u51-2 -> 8u60-1)
[2015-08-25 10:37] [ALPM] installed ttf-ubuntu-font-family (0.80-5)
[2015-08-25 10:43] [ALPM] installed ttf-google-fonts (20150805.r201-1)
[2015-08-25 10:44] [ALPM] installed ttf-ubuntu-font-family (0.80-5)
[2015-08-26 17:39] [ALPM] installed mozilla-extension-gnome-keyring-git (0.10.r36.378d9f3-1)
[2015-08-27 10:00] [ALPM] upgraded curl (7.43.0-1 -> 7.44.0-1)
[2015-08-27 10:00] [ALPM] upgraded gc (7.4.2-2 -> 7.4.2-3)
[2015-08-27 10:00] [ALPM] upgraded kmod (21-1 -> 21-2)
[2015-08-27 10:00] [ALPM] upgraded libinput (0.99.1-1 -> 1.0.0-1)
[2015-08-27 10:00] [ALPM] upgraded python2-mako (1.0.1-1 -> 1.0.2-1)
[2015-08-27 16:03] [ALPM] upgraded tdb (1.3.6-1 -> 1.3.7-1)
[2015-08-27 16:03] [ALPM] upgraded ldb (1.1.20-1 -> 1.1.21-1)
[2015-08-27 16:03] [ALPM] upgraded python2-mako (1.0.2-1 -> 1.0.2-2)
4
  • 2
    You'll have to define the meaning of "last" as this definitely doesn't list only "the last installed/upgraded packages". It lists pretty much everything... so either fix the question or the answer (or both). Aug 27, 2015 at 16:18
  • Yes correct, but it does want I want. I can see the last installed / upgraded packages.
    – BuZZ-dEE
    Aug 27, 2015 at 16:21
  • 1
    Might I recommend using tail at the end of the pipeline to get the last (10 by-default) n messages?
    – HalosGhost
    Aug 28, 2015 at 12:27
  • alias upgraded='grep -i upgraded /var/log/pacman.log | tac | less'
    – mcp
    Apr 11, 2021 at 16:04
1

Even though it would be nice to list only the packages that were upgraded during the last update invocation, it wouldn't fit into a nice one-liner.

So to extend the answer from @BuZZ-dEE, here is my approach that lists all upgraded packages from the day of last update:

grep -iE "$(tail -n1 /var/log/pacman.log | grep -iEo "([0-9]{4}-[0-9]{2}-[0-9]{2})").+upgraded" /var/log/pacman.log

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .