Skip to content

Instantly share code, notes, and snippets.

@nickfox-taterli
Last active August 11, 2020 21:57
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save nickfox-taterli/fcddd0ac724ec066b51f8e777800fea2 to your computer and use it in GitHub Desktop.
Save nickfox-taterli/fcddd0ac724ec066b51f8e777800fea2 to your computer and use it in GitHub Desktop.
Upgrade Raspbian To Buster
sudo sync
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo sed -i 's/jessie/buster/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo sync
#sudo reboot
@TryingToFindALoginWhichIsNotRegistered

I've tryed this in al virtual-box from stretch to buster and it kicked my X-server away. Better install from scratch (the script itself is OK)

@trigrab
Copy link

trigrab commented Dec 15, 2017

I've tried this as well and it did not work. But it has nothing to do with the X-server. After a reboot even the rescue shell didn't work.

The raspberry foundation does not support buster for now. The debian development for raspberry pi 3 is documented here:

For the future you could add
sudo sed -i 's/jessie/buster/g' /etc/apt/sources.list.d/raspi.list
after line 5
But as I said, the raspberry foundation does not support debian buster yet. And has no repo for buster.
So this would break things for now even more.

@janlukes
Copy link

janlukes commented Mar 7, 2018

It works. Thanks.

@jcaesar
Copy link

jcaesar commented May 10, 2018

I tried something along the lines. As long as you don't reboot, this is fine. Buster does not exist for raspbian yet, see http://archive.raspberrypi.org/debian/dists/

@s777s
Copy link

s777s commented Sep 11, 2018

I've succesfully upgraded my Raspbian to Buster a week ago (but I had to apt purge raspi-copies-and-fills coz it's broken) ant its good idea to enable root access:
sudo passwd root
sudo passwd -u root
to be able to access to the rescue shell.
And you may want to have chroot on main system (in case if your internet connection is broken on RPi after dist upgrade), something like this:
https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
But today I tried to repeat it on fresh install and it doesn't want to work((
aptitude tries to reinstall systemd and install udev, but is unable to start systemd-udevd service, so package remains unconfigured and some dependent packages too, I'm unable to start even journalctl and have to play with console.

@SuperSandro2000
Copy link

Iptables seems to be broken after that

Copy link

ghost commented Jan 19, 2019

It has become available now: http://archive.raspberrypi.org/debian/dists/buster/
But the content files are much smaller than those of stretch. It may take a while until all binaries are available for a fully functioning OS?

Edit:
Hi again, couldn't resist trying it on my live system.
So far nickfox-taterli's method + trigrab's suggestion worked fine on my raspberry pi model 3 with migrating stretch to buster.
It is too early to tell if something broke, but my HTTPS webservers are still running excellent.
Support for OpenSSL 1.1.1 +TLSv1_3 is finger licking good!

Edit 2:
It is still working very well. Didn't test desktop though, since I run a headless server from SSH, HTTP, HTTPS only.

Edit 3:
Very stable after over 2 weeks. I see myself out :)

@DaniPhii
Copy link

I agree! OpenSSL 1.1.1a with support for TLSv1.3 is neat. I upgraded my headless installation of Raspbian Jessie to Stretch and recently I've upgraded it to Buster. Everything seems to be working very well.

@HeikoRo
Copy link

HeikoRo commented Jul 10, 2019

Just quick comment.
You can avoid all the "sudo" if you run the script as sudo.
And check if it runs as root with this on top of script:

#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root/sudo"
exit
fi

@neuhaus
Copy link

neuhaus commented Jul 15, 2019

The sed command may be insufficient. It's better to replace it with

grep -rl stretch /etc/apt/ | sudo xargs sed -i 's/stretch/buster/g'

to catch files in subdirectories as well.

@tiphergane
Copy link

tiphergane commented Jul 18, 2019

Iptables seems to be broken after that

+1, iptables is broken because of nftables module who is missing in kernel folder

iptables[1126]: iptables/1.8.2 Failed to initialize nft: Protocol not supported

@HeikoRo
Copy link

HeikoRo commented Jul 19, 2019

yes, because with Buster the default is now nftables and not xtables

can be fixed by:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

(or manually fixing the links in /etc/alternatives/)

@tiphergane
Copy link

tiphergane commented Jul 19, 2019

yes, because with Buster the default is now nftables and not xtables

can be fixed by:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

(or manually fixing the links in /etc/alternatives/)

I'v tryed it, and it doesn't work, for my personal case, I had to symlink module folder to make the fix working.
sudo ln -s /lib/modules/4.19.58-v7+/ /lib/modules/4.19.57-v7+
then all is working great again.

@marcofranssen
Copy link

I did the upgrade as well. Blogged about it here. https://marcofranssen.nl/upgrade-raspbian-stretch-to-raspbian-buster/

However few days later when I tried Kodi I figured it was broken. Probably caused by broken xserver for which I tried a lot to get it working again. I also noticed kodi on buster is version 17 while on stretch we are on 18.

For now I decided to switch back to stretch.
Blogged about that here.

https://marcofranssen.nl/install-fresh-raspbian-image-on-your-raspberry-pi-part-1/
https://marcofranssen.nl/install-fresh-raspbian-image-on-your-raspberry-pi-part-2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment