For those who want to upgrade from Debian 10 (Buster) to Debian 11 (Bullseye) without starting from scratch, here comes how it can be done easily (tested on RPI4 4GB devices):
In a console as the unprivileged user (not root) :
sudo sed -i 's/buster/bullseye/' /etc/apt/sources.list
sudo sed -i 's/buster/bullseye/' /etc/apt/sources.list.d/*.list
sudo sed -i 's|bullseye/updates|bullseye-security|' /etc/apt/sources.list
Only if you previously have installed Debian’s MQTT broker (mosquitto) on the OS level (not as a HA Add-on):
sudo sed -i 's/bullseye/buster/' /etc/apt/sources.list.d/*mosquitto*.list
Continue with the OS upgrade:
sudo apt update
Only if you see the following error message after “sudo apt update
”:
The value 'buster' is invalid for APT::Default-Release as such a release is not available in the sources
Run:
sudo sed -i 's/buster/bullseye/' /etc/apt/apt.conf
sudo apt update
Important note for those who have set:
sudo apt-mark hold linux-image-arm64
due to the boot problems with the newer official kernel versions on Debian 10 on RPI4, run:
sudo apt-mark unhold linux-image-arm64
Now continue with:
sudo apt upgrade
sudo apt full-upgrade
sudo apt autopurge
The above will take some time. After it has finished it’s time to reboot the host:
sudo systemctl reboot
After the system has rebooted, open a new console and execute (again, as non-root):
sudo apt --fix-broken install
sudo apt-get install udisks2 wget
cd /usr/local/src
Now visit the OS Agent page and then replace the version number with the latest available, into the commands below. (i.e. replace all references to 1.5.1 with the latest available release):
sudo wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_aarch64.deb
sudo dpkg -i os-agent_1.5.1_linux_aarch64.deb
sudo systemctl reboot
All done. Your HA on the RPI4 should now run on Debian 11 (Bullseye).
Addendum:
The above guide is also valid for HA Supervised on the Intel architecture (i.e. on a Intel NUC). The only step different is the OS Agent part.
Instead of:
sudo wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_aarch64.deb
sudo dpkg -i os-agent_1.5.1_linux_aarch64.deb
do:
sudo wget https://github.com/home-assistant/os-agent/releases/download/1.5.1/os-agent_1.5.1_linux_x86_64.deb
sudo dpkg -i os-agent_1.5.1_linux_x86_64.deb