Created
August 11, 2009 16:58
-
-
Save btbytes/165957 to your computer and use it in GitHub Desktop.
Debian CF Install Cleanup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function doc() { | |
| echo "Removing documentation ..." | |
| find / -type d -regex '.*\(/doc/\|/info/\).*' -exec rm -r {} \; 2>/dev/null | |
| } | |
| function man() { | |
| echo "Removing man pages ..." | |
| find / -type d -regex '.*\(/man/\).*' -exec rm -r {} \; 2>/dev/null | |
| } | |
| function deb() { | |
| echo "Removing Debian packages and cleaning apt-cache ..." | |
| find / -type f -regex '.*\(\.deb$\).*' -exec rm -r {} \; 2>/dev/null | |
| rm /var/cache/apt/*.bin | |
| rm /var/lib/apt/lists/*dists* | |
| } | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: $0 doc|man|deb|all" | |
| exit 1 | |
| fi | |
| if [ $1 == "all" ]; then | |
| echo "remove all" | |
| doc | |
| man | |
| deb | |
| else | |
| eval \$1 | |
| fi | |
| ## http://kristof.vanhertum.be/wp-content/uploads/2008/03/cleanup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment