2016-07-04 13:52:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-07-04 14:20:42 +02:00
|
|
|
echo $0
|
2016-07-04 13:52:19 +02:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
debian_mirror=$1
|
2020-01-14 23:14:45 +01:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2016-07-04 13:52:19 +02:00
|
|
|
|
2016-09-06 14:33:13 +02:00
|
|
|
printf 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";\n' \
|
|
|
|
> /etc/apt/apt.conf.d/99no-install-recommends
|
|
|
|
|
2023-04-11 16:00:59 +02:00
|
|
|
printf 'Acquire::Retries "20";\n' \
|
2016-09-15 11:12:49 +02:00
|
|
|
> /etc/apt/apt.conf.d/99acquire-retries
|
|
|
|
|
2018-12-08 16:57:01 +01:00
|
|
|
cat <<EOF > /etc/apt/apt.conf.d/99no-auto-updates
|
|
|
|
APT::Periodic::Enable "0";
|
|
|
|
APT::Periodic::Update-Package-Lists "0";
|
|
|
|
APT::Periodic::Unattended-Upgrade "0";
|
|
|
|
EOF
|
2018-01-17 21:04:08 +01:00
|
|
|
|
2018-11-27 18:13:33 +01:00
|
|
|
printf 'APT::Get::Assume-Yes "true";\n' \
|
|
|
|
> /etc/apt/apt.conf.d/99assumeyes
|
2020-01-14 23:14:45 +01:00
|
|
|
|
|
|
|
cat <<EOF > /etc/apt/apt.conf.d/99quiet
|
2020-02-11 12:48:34 +01:00
|
|
|
Dpkg::Use-Pty "0";
|
|
|
|
quiet "1";
|
2020-01-14 23:14:45 +01:00
|
|
|
EOF
|
2018-11-27 18:13:33 +01:00
|
|
|
|
2021-08-23 22:48:14 +02:00
|
|
|
cat <<EOF > /etc/apt/apt.conf.d/99confdef
|
|
|
|
Dpkg::Options { "--force-confdef"; };
|
|
|
|
EOF
|
|
|
|
|
2022-10-26 14:39:05 +02:00
|
|
|
echo "man-db man-db/auto-update boolean false" | debconf-set-selections
|
|
|
|
|
2017-03-16 14:48:08 +01:00
|
|
|
if echo $debian_mirror | grep '^https' 2>&1 > /dev/null; then
|
2018-11-27 18:13:33 +01:00
|
|
|
apt-get update || apt-get update
|
2021-10-17 22:58:12 +02:00
|
|
|
apt-get install ca-certificates
|
2017-03-16 14:48:08 +01:00
|
|
|
fi
|
|
|
|
|
2018-11-27 14:07:19 +01:00
|
|
|
cat << EOF > /etc/apt/sources.list
|
2021-09-03 12:18:13 +02:00
|
|
|
deb ${debian_mirror} bullseye main
|
2022-09-05 18:45:17 +02:00
|
|
|
deb https://security.debian.org/debian-security bullseye-security main
|
2021-09-03 12:18:13 +02:00
|
|
|
deb ${debian_mirror} bullseye-updates main
|
2018-11-27 14:07:19 +01:00
|
|
|
EOF
|
2021-09-03 12:18:13 +02:00
|
|
|
echo "deb ${debian_mirror} bullseye-backports main" > /etc/apt/sources.list.d/backports.list
|
2016-07-04 13:52:19 +02:00
|
|
|
|
2018-11-27 18:13:33 +01:00
|
|
|
apt-get update || apt-get update
|
2022-10-25 18:19:31 +02:00
|
|
|
|
|
|
|
# purge things that might come from the base box, but we don't want
|
|
|
|
# https://salsa.debian.org/cloud-team/debian-vagrant-images/-/tree/master/config_space/package_config
|
|
|
|
# cat config_space/package_config/* | sort -u | grep -v '[A-Z#]'
|
|
|
|
purge="
|
|
|
|
apt-listchanges
|
|
|
|
apt-utils
|
|
|
|
bash-completion
|
|
|
|
bind9-*
|
|
|
|
bsdextrautils
|
|
|
|
build-essential
|
|
|
|
bzip2
|
|
|
|
chrony
|
|
|
|
cloud-utils
|
|
|
|
cron
|
|
|
|
dbus
|
|
|
|
debconf-i18n
|
|
|
|
debian-faq
|
|
|
|
dmidecode
|
|
|
|
doc-debian
|
|
|
|
fdisk
|
|
|
|
file
|
|
|
|
groff-base
|
|
|
|
krb5-locales
|
|
|
|
less
|
|
|
|
locales
|
|
|
|
logrotate
|
|
|
|
lsof
|
|
|
|
manpages
|
|
|
|
nano
|
|
|
|
ncurses-term
|
|
|
|
netcat-traditional
|
|
|
|
pciutils
|
|
|
|
reportbug
|
|
|
|
rsyslog
|
|
|
|
tasksel
|
|
|
|
telnet
|
|
|
|
traceroute
|
|
|
|
unattended-upgrades
|
|
|
|
vim-*
|
|
|
|
wamerican
|
|
|
|
wget
|
|
|
|
whiptail
|
|
|
|
xxd
|
|
|
|
xz-utils
|
|
|
|
"
|
2022-11-01 08:40:21 +01:00
|
|
|
# clean up files packages to be purged, then purge the packages
|
|
|
|
rm -rf /var/run/dbus /var/log/unattended-upgrades
|
2022-10-25 18:19:31 +02:00
|
|
|
apt-get purge $purge
|
|
|
|
|
2018-11-27 18:13:33 +01:00
|
|
|
apt-get upgrade --download-only
|
|
|
|
apt-get upgrade
|
2016-07-04 13:52:19 +02:00
|
|
|
|
2021-08-25 14:51:20 +02:00
|
|
|
# again after upgrade in case of keyring changes
|
|
|
|
apt-get update || apt-get update
|
|
|
|
|
2016-07-04 13:52:19 +02:00
|
|
|
packages="
|
2022-10-11 16:21:59 +02:00
|
|
|
apksigner
|
2021-09-03 13:48:36 +02:00
|
|
|
default-jdk-headless
|
|
|
|
default-jre-headless
|
2022-05-19 15:43:55 +02:00
|
|
|
dexdump
|
2021-09-03 13:48:36 +02:00
|
|
|
fdroidserver
|
2022-10-11 12:09:05 +02:00
|
|
|
git-svn
|
2021-09-03 13:48:36 +02:00
|
|
|
gnupg
|
2022-10-11 12:09:05 +02:00
|
|
|
mercurial
|
2021-10-17 21:47:21 +02:00
|
|
|
patch
|
|
|
|
rsync
|
2022-04-22 10:28:25 +02:00
|
|
|
sdkmanager
|
2020-05-27 17:40:23 +02:00
|
|
|
sudo
|
2016-07-04 13:52:19 +02:00
|
|
|
"
|
2021-09-03 13:48:36 +02:00
|
|
|
|
2018-11-27 18:13:33 +01:00
|
|
|
apt-get install $packages --download-only
|
|
|
|
apt-get install $packages
|
2022-10-25 18:19:31 +02:00
|
|
|
|
|
|
|
# fdroidserver comes from git, it was installed just for dependencies
|
2022-10-25 19:11:24 +02:00
|
|
|
apt-mark manual `apt-cache depends fdroidserver | sed -nE 's,^[| ]*Depends: ([a-z0-9 -]+),\1,p'`
|
2021-09-03 13:48:36 +02:00
|
|
|
apt-get purge fdroidserver
|
2016-07-04 13:52:19 +02:00
|
|
|
|
2022-10-25 18:19:31 +02:00
|
|
|
# clean up things that will become outdated anyway
|
2022-10-25 19:11:24 +02:00
|
|
|
apt-get autoremove --purge
|
2022-10-25 18:19:31 +02:00
|
|
|
apt-get clean
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2016-07-04 13:52:19 +02:00
|
|
|
highestjava=`update-java-alternatives --list | sort -n | tail -1 | cut -d ' ' -f 1`
|
|
|
|
update-java-alternatives --set $highestjava
|