Removing pkgs installed in the last day

Does pkg install record when a pkg was installed? If so, then maybe I could work out how to remove pkgs installed in the last day... Sometimes when trying to get something to work you install all sorts of pkgs until a program works, but you don't really know how many of those pkgs you installed were actually necessary...
 
You can also check /var/log/messages, packages being installed, deleted or upgraded is recorded there too.
 
You can combine that to do what you want in a oneliner:
Code:
pkg query -e "%t >= $(($(date +%s) - 86400))" %n | xargs pkg remove
(not sure whether this works in a C shell…)
 
Back
Top