You are not logged in.
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
cat /var/log/pacman.log
Offline
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
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