1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00
fdroidserver/buildserver/provision-apt-get-install
2022-10-10 21:22:59 +02:00

70 lines
1.6 KiB
Bash

#!/bin/bash
echo $0
set -e
set -x
debian_mirror=$1
export DEBIAN_FRONTEND=noninteractive
printf 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";\n' \
> /etc/apt/apt.conf.d/99no-install-recommends
printf 'APT::Acquire::Retries "20";\n' \
> /etc/apt/apt.conf.d/99acquire-retries
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
printf 'APT::Get::Assume-Yes "true";\n' \
> /etc/apt/apt.conf.d/99assumeyes
cat <<EOF > /etc/apt/apt.conf.d/99quiet
Dpkg::Use-Pty "0";
quiet "1";
EOF
cat <<EOF > /etc/apt/apt.conf.d/99confdef
Dpkg::Options { "--force-confdef"; };
EOF
if echo $debian_mirror | grep '^https' 2>&1 > /dev/null; then
apt-get update || apt-get update
apt-get install apt-transport-https ca-certificates
fi
cat << EOF > /etc/apt/sources.list
deb ${debian_mirror} bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb ${debian_mirror} bullseye-updates main
EOF
echo "deb ${debian_mirror} bullseye-backports main" > /etc/apt/sources.list.d/backports.list
apt-get update || apt-get update
apt-get upgrade --download-only
apt-get upgrade
# again after upgrade in case of keyring changes
apt-get update || apt-get update
packages="
default-jdk-headless
default-jre-headless
dexdump
fdroidserver
gnupg
patch
rsync
sudo
"
apt-get install $packages --download-only
apt-get install $packages
apt-get purge fdroidserver
highestjava=`update-java-alternatives --list | sort -n | tail -1 | cut -d ' ' -f 1`
update-java-alternatives --set $highestjava