So a while back, I decided to get a Raspberry Pi to setup as a UPnP media server for my local network (not accessible from outside the network). Of course, the standard procedure is to install Raspbian, which is a customized Debian-based distribution that works well with the Raspberry Pi.
However, this presents an annoyance: the Raspbian repositories contain a very tiny subset of the Debian respositories. This means that your software choice is reduced by a lot and, given that I wanted this to be a “set it and forget it” type of media server, compiling and updating programs from source was mostly out of the question (especially when that software was available in Debian!). I decided to go on an adventure and convert Raspbian to Debian proper.
Note: I did this a while ago, so I may be missing some steps. Please let me know in the comments and I will update it with more details if need be!
First, I noticed that the architecture Raspbian refers to as
armhf is actually an amalgamation of both
armhf in Debian. That is, just adding the Debian repositories and upgrading will probably break your system. This was the first issue I ran into when I naïvely just edited
/etc/apt/sources.list to include
deb http://ftp.us.debian.org/debian/ sid main contrib non-free. When I ran
sudo apt update && sudo apt dist-upgrade, everything completely broke.
This meant I needed to switch the architecture from
armel. The first step to doing this was the following:
sudo apt update && sudo apt dist-upgrade. You want a clean, fully upgraded state to start from.
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi to
deb [arch=armhf] http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi.
3. In the same file, add the line
deb [arch=armel] http://ftp.us.debian.org/debian/ sid main contrib non-free.
deb http://archive.raspberrypi.org/debian/ buster main ui to
deb [arch=armhf] http://archive.raspberrypi.org/debian/ buster main ui.
sudo dpkg --add-architecture armel.
sudo apt update.
7. Here’s the really messy part. You need to slowly migrate every package you can from the
armhf version in Raspbian to
armel in Debian sid. This involves running
sudo apt install and manually resolving dependencies. Do not run
sudo apt upgrade because, at this stage, the dependency resolver will probably just choke. My advice here is to start with core libraries and then slowly move to bigger and bigger packages. Once you’ve switched
apt over, it definitely gets easier, but it’s still a tedious process.
8. Once you’ve done this, you can now use
sudo apt update and stuff as normal and it should “Just Work”™.
An alternative to this horrifically messy process is to flash this image instead of the default Raspbian image. It is out of date, so you’ll have a large system update to run after flashing it, but it should save you the horrifically messy transition.