Skip to content

Instantly share code, notes, and snippets.

@kaderud
Created June 23, 2020 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaderud/f9df6b7329c70f4f90eccbb1b67d6904 to your computer and use it in GitHub Desktop.
Save kaderud/f9df6b7329c70f4f90eccbb1b67d6904 to your computer and use it in GitHub Desktop.
Find and purge Ubuntu packages
#!/bin/bash
# list all Removed packages with conf files (rc), and just print the package name
dpkg --list | grep ^rc | awk '{ print $2 }'
# remove the packages/conf files
apt purge `dpkg --list | grep ^rc | awk '{ print $2 }'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment