Sunday, November 15, 2009

list installed packages on debian and uninstall those not correctly removed.

dpkg --get-selections

Will give you a list of packages currently installed on a debian system (possibly works for Ubuntu too?). You may see a few which are listed as "deinstall". They've not uninstalled correctly. To uninstall them use this command I found on the debian mailing lists to purge them:

dpkg --get-selections | grep deinstall | cut -f1 | xargs dpkg -P

1 comment:

nobodycares said...

Aptitude offers a really nice way of solving this as well. Though to me the interface needs a lot of getting used to. However, once I got over it I found it superior to apt for solving these kind of issues.