Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 896 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 896 Bytes

dpkg-purge-deleted

Removes all deleted but not purged packages on Debian and Ubuntu systems.

Rationale

When you remove packages via dpkg, apt-get or aptitude, it doesn't remove everything, it leaves things like configuration files behind. You can tell each of these commands to delete those as well (i.e. purge), but I sometimes forget. Plus apt-get autoremove can't do it.

In the past few years, I regularly did something like this:

for i in `dpkg -l | grep ^rc | cut -d" " -f 3`; do dpkg -P $i; done

But today I was fed up with that. Today I created this script.

Installation

Download the script, put in on root's $PATH and make it executable.

Usage

Just execute dpkg-purge-deleted as root. Don't worry, it will ask you before purging anything.