Created
December 6, 2016 12:41
-
-
Save trisgelar/b2ba58e693ca5a3e45dc47da4782b9e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### pars for fun: install | remove | rollback | |
function apt-history(){ | |
case "$1" in | |
install) | |
grep 'install ' /var/log/dpkg.log | |
;; | |
upgrade|remove) | |
grep $1 /var/log/dpkg.log | |
;; | |
rollback) | |
grep upgrade /var/log/dpkg.log | \ | |
grep "$2" -A10000000 | \ | |
grep "$3" -B10000000 | \ | |
awk '{print $4"="$5}' | |
;; | |
*) | |
cat /var/log/dpkg.log | |
;; | |
esac | |
} | |
#https://askubuntu.com/questions/21657/how-do-i-show-apt-get-package-management-history-via-command-line/337006 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment