You are not logged in.

#1 2008-08-26 08:26:12

valpa
Member
Registered: 2008-07-05
Posts: 8

How can I list all the recently installed package

Hi

I added some package 2 days ago. Now I want to find it out, but I don't remember the name. How can I list the packages I installed 2 days ago?


Thanks
valpa

Offline

#2 2008-08-26 08:33:19

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: How can I list all the recently installed package

cat /var/log/pacman.log

Offline

#3 2008-08-26 09:11:46

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: How can I list all the recently installed package

A more complicated alternative :
http://bbs.archlinux.org/viewtopic.php?id=53777


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#4 2008-08-26 14:46:48

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: How can I list all the recently installed package

Here's another script. This extracts the most recent install or remove from the /var/log/pacman.log, eliminating install..remove and remove..install patterns. Only the most recent install or remove gets reported. I have it in my .bashrc:



function pac-log {
    # Usage: pac-log [n=20]
    #    show persisting installs/removes in last n lines of pacman.log (install X...remove X pairs and the converse are filtered out)

    {
        if [[ -e /var/log/pacman.log.1 ]]; then
            cat /var/log/pacman.log.1
        elif [[ -e /var/log/pacman.log.1.gz ]]; then
            zcat /var/log/pacman.log.1.gz
        fi
        cat /var/log/pacman.log
    } \
    | egrep '] installed|] removed' | tail -n "${1-20}" \
    | python <(cat << EOF
import sys, re
pkgre=re.compile(r'\[[^]]*\] (installed|removed) ([^ ]*) .*')
lines = []
hist = {
    'installed': {},
    'removed': {},
}
otheract = {
    'installed':'removed',
    'removed':'installed',
}
li=0
for l in sys.stdin:
    m = pkgre.match(l)
    if m:
        act,pkg = m.groups()
        hist[act].setdefault(pkg,[]).append(li)
        lines.append((li,act,pkg,l[:-1]))
        li+=1
for li,act,pkg,line in lines:
    if li==hist[act][pkg][-1] and li>hist[otheract[act]].get(pkg,-1):
        print "%s" % (line,)
EOF
)

}

Offline

Board footer

Powered by FluxBB