#!/bin/sh
dpkg --get-selections | awk '$2 == "install"' > dpkg-selections-installed.state
debconf-get-selections |grep -Ev '^[[:space:]]*(#|$|.*error[[:space:]]*$)' > debconf.state
aptitude -F '%p' search '~i~M' > autoinstalled-packages.list
awk '/^Package:/ { pkgname=$2; } /^User-Tags:/ { print $pkgname, $2 } {}' < /var/lib/aptitude/pkgstates > aptitude.state
