#!/bin/sh echo echo "live-config hook: clean up chroot" #Removing unused packages. Candidates: man-db for PACKAGE in apt-utils aptitude-common firmware-intelwimax manpages info; do if ! apt-get remove --purge --yes "${PACKAGE}"; then echo "WARNING: ${PACKAGE} isn't installed"; fi done #Autoremove apt-get autoremove --yes || true #Removing unused files find . -name *~ -print0 | xargs -0 rm -f rm -rf /usr/include/* rm -rf /usr/share/doc/* rm -rf /usr/share/man/* rm -rf /usr/share/info/* rm -rf /usr/share/linda/* rm -rf /var/cache/man/* #Remove unneeded translations for i in /usr/share/locale/*; do if [ ${i##*/} != "en" ] && [ ${i##*/} != "ru" ] && [ ${i##*/} != "uk" ]; then rm -rf ${i} fi done # Truncating logs for FILE in $(find /var/log/ -type f); do : > ${FILE}; done