Upgrade Raspberry Pi From Buster to Bullseye

With the recent release of Bullseye you may encounter the following message when running sudo apt update:

N: Repository ‘http://raspbian.raspberrypi.org/raspbian buster InRelease’ changed its ‘Suite’ value from ‘stable’ to ‘oldstable’


So, what happened?

No need to be alarmed. Debian simply released Bullseye as the stable version, deprecating Buster, and Raspian runs slightly behind. You can run with this until Raspian update the repo to support Buster its usually not far behind.


You’ll be asked to accept the repository change so just enter ‘y’ and press enter. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

If you missed the prompt you can run the following to accept the change and perform an update from the oldstable release repo.

sudo apt-get update --allow-releaseinfo-change

Carry on and once the release comes out back up your data files as appropriate and perform a fresh install… or upgrade…


Ideally, fresh is best and recommended.

However, it is possible to simply upgrade. I tried this out on a Raspberry Pi 3 and it was smooth. Note, I did opt to go back and do a fresh install regardless as was moving some workloads around. I was curious to try the process and that is hundred percent why I have some devices for experimentation.


BACKUP YOUR FILES!
Several blog posts mention that the process is not always smooth. Please ensure you back up any relevant data files before upgrading.

With backup completed login and run the following:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Update the buster repository.
sudo apt update

# Run a full distribution upgrade.
sudo apt dist-upgrade -y

# Update the firmware.
sudo rpi-update

# Edit the sources.list file.
# - From: deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# - To:   deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
sudo sed 's/buster/bullseye/g' /etc/apt/sources.list

# Update the bullseye repository.
sudo apt update

# Run a full distribution upgrade.
sudo apt dist-upgrade -y

# Clean up deprecated files.
sudo apt autoclean

# Reboot
sudo reboot now

Bonus Tip

Note the use of sed.

sed is a stream editor that allows you to perform some fancy text transformations on the fly. The command above will recursively search the file /etc/apt/sources.list for buster and replace each occurrence with bullseye.

Learn more about the command. but as always be careful and test to ensure you get the desired result.

Done!