You are here

HOWTO: List the installed files on your Debian system

I am trying to clean up a laptop to give back to Keith Packard, who graciously loaned it to me years ago. I'd like to remove most of the files that weren't part of the Debian installation on the laptop. The first step in this process is figuring out what files are owned by a Debian package. This script seems to do the trick… [Because of a Drupal bug I have to put some text here if I want the first line of the script to come out right, since I'm trying to split the post here and the whitespace gets eaten. Sorry.]

#!/bin/sh # Copyright © 2014 Bart Massey # Print a list of pathnames of all files on the system that # are listed as owned by a Debian package. dpkg -l | awk '$1=="ii"{print $2;}' | while read PKG do dpkg --listfiles $PKG done

Part 2 later, where I actually find the files I want. I seem to have about a half-million installed files on my home box, so there will be some interesting issues. Enjoy. Fob