X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FDEBORPHAN%2F98-clean-chroot;h=42ed9c24a028e350ccc72ac575bf927061dd5fa5;hb=332ae52de9efa6a0ac5c3619823fe547e35828a0;hp=68136eab3fd9c3b1a9ee32db33ac5ecc7dd39c91;hpb=f565065789c9c28146a9acd2efe5a5a1d2b0d2fb;p=grml-live.git diff --git a/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot b/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot index 68136ea..42ed9c2 100755 --- a/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot +++ b/etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot @@ -14,17 +14,13 @@ if ! [ -x $target/usr/bin/deborphan ] ; then exit 0 fi -# avoid file-rc being considered for removal by deborphan -if [ -d $target/usr/share/file-rc -a -x $target/usr/bin/deborphan ] ; then - echo "Adding file-rc to keep-list of deborphan to avoid accidental removal" - $ROOTCMD deborphan --add-keep file-rc || /bin/true -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 @@ -34,6 +30,7 @@ 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