1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#!/bin/sh
# Copyright: 2012-2024 gregor herrmann <gregoa@debian.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
APTVERSION=$(dpkg-query -f '${Version}\n' -W apt)
pkgavail() {
for p in $(apt-get indextargets --format '$(FILENAME)' "Created-By: Packages") ; do
/usr/lib/apt/apt-helper cat-file $p | grep -q $1 && return 0
done
return 1
}
EAT=
if pkgavail eatmydata ; then
EAT=eatmydata
fi
FCNTLLOCK=
if pkgavail libfile-fcntllock-perl ; then
FCNTLLOCK=libfile-fcntllock-perl
fi
UBUNTU=
if dpkg-vendor --derives-from Ubuntu ; then
UBUNTU="ubuntu-keyring"
fi
RASPBIAN=
if dpkg-vendor --derives-from Raspbian ; then
RASPBIAN="raspbian-archive-keyring"
fi
apt-get -y install debfoster
debfoster -o MaxPriority=required -o UseRecommends=no \
-o InstallCmd="apt-get install -y" -o RemoveCmd="apt-get --purge remove -y --allow-remove-essential" \
-f -n -v \
apt aptitude debfoster cowdancer build-essential ccache $EAT $UBUNTU $RASPBIAN $FCNTLLOCK
rm -rf /var/lib/debfoster/keepers
apt-get -y purge debfoster
apt-get -y autoremove
dpkg --list | grep '^rc\b' | awk '{ print $2 }' | xargs apt-get -y purge
|