Along with the good advice you have been given by cruzer001.
Warning have good back ups in place before going forward>
The short answer - you could use the following command:
Code:
apt-get -s install $(apt-history rollback | tr '\n' ' ')
if it does what you want remove the -s and run it again. Here are the steps I took to get this working properly:
*I temporarily trimmed my /var/log/dpkg.log to leave just today's upgrade
**I installed the tiny script apt-history from here into ~/.bashrc and ran
Code:
apt-history rollback > rollback.txt
This provides a nicely formatted list of versioned packages to roll-back to by feeding it into apt-get install. Trim this list as needed in a text editor and then run (with -s for dry-run first):
Code:
apt-get -s install $(cat rollback.txt | tr '\n' ' ')
Now without the safety net:
apt-get install $(cat rollback.txt | tr '\n' ' ')
Apt will warn about the downgrades which is expected. To prevent this rollback to be overwritten by the next upgrade, the packages will need to be pinned, until the original issue is resolved. For example with: "apt-mark hold zfsutils libzfs2 ..."
My script used is:
Code:
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
}
Fair warning again BACKUPS BACKUPS BACKUPS Prevention is 90% of the cure.
Bookmarks