How to setup Debian 11 on Raspberry Pi 4
In this article, I'd like to discuss how I setup Debian 11 on Raspberry Pi 4
Raspberry Pi 4 is a small logic board with Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC (System on a Chip).
You can get it with 2GB, 4GB or even 8GB of Memory. I'm using Raspberry Pi 4 with 8G of memory with 32G microSD Card.
- How to setup Debian 11 on Raspberry Pi 4
Here is basic System Requirements for this article.
+ Raspberry Pi 4 (4G or 8G) + microSD Card (32G or higher) + Case for Raspberry Pi 4
Download Raspberry Pi 4 Image
You can download RPI 4(4G) Verified Image for Bullseye from https://raspi.debian.net/tested-images/
$ sudo apt update $ sudo apt install curl wget $ wget https://raspi.debian.net/verified/20210823_raspi_4_bullseye.img.xz
Write the image to microSD Card
Please refer to following document to write the image to microSD Card for Linux-based. https://wiki.debian.org/RaspberryPiImages
If you have macOS, use balenaEtcher https://www.balena.io/etcher/
Boot Raspberry Pi 4 with microSD
At this point, I've already assembled Raspberry Pi 4 on its own Case and plugin to a Display via HDMI and wireless Keyboard and Mouse Combo.
Plugin microSD to Raspberry Pi 4 and boot from it.
The default username is root without password (set it to your own)
Case for Raspberry Pi 4
There are lots of Cases available for Raspberry Pi 4. I wanted a Aluminum Case with built-in Fan so I picked:
They also provide a script to control fan.
$ curl https://download.argon40.com/argon1.sh | bash ... The following additional packages will be installed: rpi.gpio-common The following NEW packages will be installed: python3-rpi.gpio rpi.gpio-common ... The following additional packages will be installed: i2c-tools libi2c0 read-edid Suggested packages: libi2c-dev python-smbus The following NEW packages will be installed: i2c-tools libi2c0 python3-smbus read-edid ... *************************** Argon One Setup Completed. *************************** You may need to reboot for changes to take effect Use argonone-config to configure fan Use argonone-uninstall to uninstall
$ argonone-config -------------------------------------- Argon One Fan Speed Configuration Tool -------------------------------------- WARNING: This will remove existing configuration. Press Y to continue:Y Thank you. Select fan mode: 1. Always on 2. Adjust to temperatures (55C, 60C, and 65C) 3. Customize behavior 4. Cancel NOTE: You can also edit /etc/argononed.conf directly Enter Number (1-4):1 Fan always on.
Remote Login to Raspberry Pi 4
To remote login (ssh) to RPI4, I would recommend to create your own account.
# adduser tchung # passwd tchung
I also recommend to install vim and sudo.
# apt update # apt install vim # update-alternatives --config editor (choose vim.basic) # apt install sudo # adduser tchung sudo
logout and login as yourself
Neofech on Raspberry Pi 4
I always install neofetch on new system for login script
$ sudo apt install neofetch $ echo; neofetch --ascii_colors 1 1 1 1 1 1
Here is result.
Removing Black Border for RPI4
To remove the Black Border around the screen, add following line in the config.txt and reboot.
$ sudo vi /boot/firmware/config.txt disable_overscan=1
Control Power LED for RPI4
If your RPI4 Power LED stopped working after installing Daily Build Image, you can create following systemd service.
# vi /etc/systemd/system/rpi-led-pwr.service [Unit] Description=Control Raspberry Pi PWR (power) LED [Service] Type=oneshot RemainAfterExit=yes ExecStart=sh -c "echo 1 > /sys/class/leds/PWR/brightness" ExecStop=sh -c "echo 0 > /sys/class/leds/PWR/brightness" [Install] WantedBy=multi-user.target # systemctl daemon-reload # systemctl enable rpi-led-pwr.service # systemctl start rpi-led-pwr.service
Here is more information from RPI4:
$ sudo apt install lsb-release $ lsb_release -d Description: Debian GNU/Linux 11 (bullseye)
$ uname -a Linux rpi4-20210823 5.10.0-8-arm64 #1 SMP Debian 5.10.46-5 (2021-09-23) aarch64 GNU/Linux
$ lscpu | egrep 'Arch|CPU|Byte|Vendor|Model' Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Vendor ID: ARM Model: 3 Model name: Cortex-A72 CPU max MHz: 1500.0000 CPU min MHz: 600.0000 NUMA node0 CPU(s): 0-3
$ df -hT Filesystem Type Size Used Avail Use% Mounted on udev devtmpfs 3.8G 0 3.8G 0% /dev tmpfs tmpfs 781M 644K 781M 1% /run /dev/mmcblk1p2 ext4 30G 965M 27G 4% / tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock /dev/mmcblk1p1 vfat 296M 75M 222M 26% /boot/firmware tmpfs tmpfs 781M 0 781M 0% /run/user/1000
$ free -hw total used free shared buffers cache available Mem: 7.6Gi 89Mi 7.1Gi 0.0Ki 12Mi 399Mi 7.3Gi Swap: 0B 0B 0B