Raspberry: update the Raspbian operating system from Stretch to Buster

2 minutes of reading
  • Upgrade the Raspberry Raspbian operating system version from the Stretch version to the Buster version
  • Difficulty level: medium
  • Update Searchnamesoftware
  • Raspbian Buster
  • Raspberry configured and working with the Raspbian Stretch operating system on board
GUIDE more indicated for:

All environments

Notes and disclaimer
  • qualsiasi modifica all'impianto elettrico dev'essere effettuata da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (this guide is for educational purposes only);
  • any changes implemented in probefore a device will void the warranty.
Driving review: 1.0


Starting from the end of June 2019 the Raspberry Foundation has made available the new official version of the profirst operating system for Raspberry Pi, Raspbian, called in this version "Buster".

The reasons for switching from the previous version ("Stretch") to this new one are many and are not the subject of this guide, assuming that the user who ventures into this activity already knows the merits of the new version. In particular, here you can read the list of news (here instead the release notes).

ATTENZIONE: To users who use Home Assistant installed on Raspbian we recommend reading di this special which illustrates why it is useful to update from Stretch to Buster.

First to carry out the procedura is recommended - as always in these cases - to carry out a backup.

Version check

First you need to check that the version you are going to update is actually the Raspbian Stretch. To do this, run the following command to terminate SSH (or locally):

lsb_release -a

The output should be as follows:

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

Absolutely mandatory, to carry out this guide, that the version indicated is "stretch".

Update Searchnamento

It is recommended to perform the next onenamento connecting locally to the Raspberry (via keyboard, mouse and video): the higher onenamevia SSH is possible (we've tested it) but it's still safer to do it in the first mode.

To start the highernamento, execute the following command:

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


sudo apt update && sudo apt dist-upgrade

let the unit work, it will take time.

Nb For any proproblems in executing the command, refer to to the comments below.

After a while la procedura will ask if it can automatically restart services. Answer yes, but if you are connected via SSH, remember to delete the "ssh" item from the list of services proplaced as if to restart, otherwise the connection will fall.

Will be placed also other questions, specifically on the opportunity to update or leave certain configuration files unchanged. If not sure, indicate to leave the contents unchanged.

At the end

When the procedura has been completed, reboot using the command:

sudo reboot

Once Raspbian has restarted, check that the new version is the correct one using the command again:

lsb_release -a

The output this time should be the following:

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Finally, perform a cleanup of packages no longer needed using the command:

sudo apt autoremove

Well landed on the new "Buster" version.

Home Assistant Official LogoATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Home Assistant, for any doubt, question, information on the specific merit of these components.

Please comment below