Linux

Debian

Debian, also known as Debian GNU/Linux, is a GNU/Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 19931.

First, download and flash a prebuilt vanilla Debian image for your Raspberry Pi model:

Adjust /dev/sda to the path of your SD card.

# Raspberry Pi Zero (W)/1
curl -L 'https://raspi.debian.net/tested/20220121_raspi_1_bullseye.img.xz' | xzcat >/tmp/debian.img
# Raspberry Pi 2
curl -L 'https://raspi.debian.net/tested/20220121_raspi_2_bullseye.img.xz' | xzcat >/tmp/debian.img
# Raspberry Pi 3
curl -L 'https://raspi.debian.net/tested/20220121_raspi_3_bullseye.img.xz' | xzcat >/tmp/debian.img
# Raspberry Pi 4/400
curl -L 'https://raspi.debian.net/tested/20220121_raspi_4_bullseye.img.xz' | xzcat >/tmp/debian.img

sudo umount /dev/sda{,0,1,2}

sudo dd if=/tmp/debian.img of=/dev/sda bs=4M status=progress

sync
sudo umount /dev/sda{,0,1,2}

For vanilla Debian, you can now mount the SD card and set the root password to a random string, add your authorized_keys and set the hostname like so:

sudo umount /dev/sda{,0,1,2}

sudo mkdir -p /mnt/raspi-boot
sudo mount /dev/sda1 /mnt/raspi-boot

sudo tee -a /mnt/raspi-boot/sysconf.txt<<EOT
root_pw=$(openssl rand -base64 12)
root_authorized_key=$(cat ~/.ssh/id_rsa.pub)
hostname=jeans-box
EOT

sync
sudo umount /dev/sda{,0,1,2}

Raspbian

Raspberry Pi OS (formerly Raspbian) is a Debian-based operating system for Raspberry Pi2.

Alternatively, you may want to download and flash Raspbian instead of vanilla Debian by using the Raspberry Pi Imager. You can set the options mentioned above using the imager GUI; don't configure WLAN using it, as we'll use a static method instead.

1

From Wikipedia, last checked 2022-02-19 (https://en.wikipedia.org/wiki/Debian) 2: From Wikipedia, last checked 2022-03-07 (https://en.wikipedia.org/wiki/Raspberry_Pi_OS)