使用 aptitude 管理的會記錄在 /var/log/aptitude
但底層都是 dpkg,所以會在 /var/log/dpkg.log
將以下函式加入 ~/.bashrc
function apt-history(){ case "$1" in install) cat /var/log/dpkg.log | grep 'install ' ;; upgrade|remove) cat /var/log/dpkg.log | grep $1 ;; rollback) cat /var/log/dpkg.log | grep upgrade | \ grep "$2" -A10000000 | \ grep "$3" -B10000000 | \ awk '{print $4"="$5}' ;; *) cat /var/log/dpkg.log ;; esac }
之後就可以執行如 apt-history install 來查看
Reference :
Linux Commando: How to show apt log history
沒有留言:
張貼留言