fi
# remove all packages not necessary anymore:
+echo "Executing apt-get -y --purge autoremove"
$ROOTCMD apt-get -y --purge autoremove
# remove packages until deborphan does not find anymore:
while [ "$($ROOTCMD deborphan)" != "" ] ; do
+ echo "Executing deborphan"
$ROOTCMD apt-get -y --purge remove $($ROOTCMD deborphan)
done
PURGE_PACKAGES=$($ROOTCMD dpkg --list | awk '/^rc/ {print $2}')
if [ -n "$PURGE_PACKAGES" ] ; then
+ echo "Getting rid of packages which have been removed but not yet purged: $PURGE_PACKAGES"
$ROOTCMD dpkg --purge $PURGE_PACKAGES
fi