rendered paste body#!/bin/bashOLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)YELLOW="\033[1;33m"RED="\033[0;31m"ENDCOLOR="\033[0m"if [ $USER != root ]; then echo -e $RED"Error: must be root" echo -e $YELLOW"Exiting..."$ENDCOLOR exit 0fiecho -e $YELLOW"Cleaning apt cache..."$ENDCOLORaptitude cleanecho -e $YELLOW"Removing old config files..."$ENDCOLORsudo aptitude purge $OLDCONFecho -e $YELLOW"Removing old kernels..."$ENDCOLORsudo aptitude purge $OLDKERNELSecho -e $YELLOW"Emptying every trashes..."$ENDCOLORif [ -e /home/*/.local/share/Trash/*/** ]; thenrm -r /home/*/.local/share/Trash/*/**fiif [ -e /root/.local/share/Trash/*/** ]; thenrm -rf /root/.local/share/Trash/*/**fiecho -e $YELLOW"Script Finished!"$ENDCOLOR