wiki/ FlightComputerNotes

Cleanup scripts

/etc/apt/apt.conf.d/90local-tiny:

Dir::Cache {
    pkgcache "";
    srcpkgcache "";
}
DPkg::Post-Invoke {"/usr/local/sbin/cleanup";}

/usr/local/sbin/cleanup:

#!/bin/bash
apt-get clean
dpkg --clear-avail
rm -rf /usr/share/{doc,info,locale,man,lintian/overrides}/*
rm -rf /usr/doc/* /usr/lib/gconv/*
rm -f /var/lib/dpkg/info/*.md5sums
Z=/usr/share/zoneinfo
find $Z -not -type d -not -path $Z -not -path $Z/UTC -not -path $Z/localtime \
        -not -path "`readlink /etc/localtime`" -print0 | xargs -0 rm -f
find $Z -type d -empty -print0 | xargs -0r rmdir
# For pci.ids: ssh root@lv2 lspci -x | lspci -F /dev/stdin
rm -f /var/lib/dpkg/*-old /var/cache/debconf/*-old /usr/share/misc/pci.ids
echo "NOTE: if done with apt, run apt-list-cleanup."

/usr/local/sbin/apt-list-cleanup:

#!/bin/bash
rm -f /var/lib/apt/lists/*{Packages,Release}
echo "Done. You will need to run apt-get update next time you want to use apt."