btbytes (owner)

Revisions

gist: 165957 Download_button fork
public
Description:
Debian CF Install Cleanup script
Public Clone URL: git://gist.github.com/165957.git
Embed All Files: show embed
cleanup.sh #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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