Skip to content

Instantly share code, notes, and snippets.

Created October 18, 2010 16:50
Show Gist options
  • Save anonymous/632559 to your computer and use it in GitHub Desktop.
Save anonymous/632559 to your computer and use it in GitHub Desktop.
# apt/aptitude/dpkg and debconf cache
echo "Purging apt/aptitude/dpkg and debconf cache.."
rm -r $NEWINSTPATH/var/cache/apt/archives/*.deb
rm -r $NEWINSTPATH/var/cache/apt/*.bin
rm -r $NEWINSTPATH/var/lib/apt/lists/*debian*
rm -r $NEWINSTPATH/var/lib/aptitude/*.old
rm -r $NEWINSTPATH/var/lib/dpkg/*-old
rm -r $NEWINSTPATH/var/cache/debconf/*-old
# logfiles
echo "Purging logfiles.."
rm -r $NEWINSTPATH/var/log/{*.log*,*.gz}
rm -r $NEWINSTPATH/var/log/*/{*.log*,*.gz}
# docs and man pages
echo "Purging docs and man pages.."
rm -r $NEWINSTPATH/usr/share/doc*/*
rm -r $NEWINSTPATH/usr/share/man/*/*.gz
rm -r $NEWINSTPATH/usr/share/man/*/*/*.gz
# system configurations
echo "Purging configuration files.."
rm -r $NEWINSTPATH/etc/hostname
# temp/run
rm -r $NEWINSTPATH/var/run/{*.pid,*.sock}
rm -r $NEWINSTPATH/tmp/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment