# go-faster apt/dpkg
echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/unsafe-io
-# location based redirector gets it wrong with company VPN; also add deb-src
-sed -i "s/deb.debian.org/ftp.de.debian.org/; /^deb\b/ { p; s/^deb/deb-src/ }" /etc/apt/sources.list
+# otherwise installing systemd fails
+umount /var/log/journal
+
+# enable sources
+if [ -e /etc/apt/sources.list.d/debian.sources ]; then
+ sed -i "/^Types:/ s/deb$/deb deb-src/" /etc/apt/sources.list.d/debian.sources
+fi
apt-get update
apt-get install -y libnss-myhostname sudo eatmydata libcap2-bin
# allow sudo with empty password
sed -i "s/nullok_secure/nullok/" /etc/pam.d/common-auth
+
+# unbreak slow host name resolution
+sed -i "/^hosts:/ s/files dns myhostname/files myhostname dns/" /etc/nsswitch.conf
'
toolbox run --container $RELEASE sh -exc '
-# otherwise installing systemd fails
-sudo umount /var/log/journal
-
# useful hostname
. /etc/os-release
echo "${ID}-${VERSION_ID:-sid}" | sudo tee /etc/hostname