Created
April 27, 2009 22:35
-
-
Save dreiss/102793 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
#!/bin/bash | |
set -e | |
# This script identifies the packages manually installed on your old | |
# Debian system that are not installed on your new Debian system. | |
if test "$#" -ne "2" ; then | |
echo >&2 "usage: $0 /path/to/old/var/lib/dpkg /path/to/old/var/lib/apt" | |
exit 1 | |
fi | |
export COLUMNS=256 | |
comm -23 \ | |
<( comm -23 \ | |
<(dpkg-query --admindir $1 -l | awk '{print $2}' | sort) \ | |
<(dpkg-query -l | awk '{print $2}' | sort) \ | |
) \ | |
<( \ | |
sed -n '/^$/!{;H;d;};x;/\nAuto-Installed: 1/s/^\nPackage: \([^\n]*\)\n.*/\1/p' "$2/extended_states" | sort \ | |
) \ | |
| cat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment