Most (if not all) installation instructions for Jenkins CI server on Debian 12 are incomplete or downright wrong.
Below is a small script to automate this:
#!/bin/bash
if [ ! -f /etc/debian_version ]; then
echo "It seems this not a Debian system and the script only works there, exiting"
exit 1
fi
if [ `whoami` != "root" ]; then
echo "Must be run as root user, aborting ..."
exit 1
fi
apt-get update
apt-get install openjdk-17-jdk wget curl ant ant-contrib -y
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | tee \
/usr/share/keyrings/jenkins-keyring.asc
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
apt-get update
apt-get install jenkins -y
systemctl start jenkins
systemctl enable jenkins




