Raspbian GNU/Linux upgrade from Stretch to Raspbian Buster 10

The upgrade from Raspbian Stretch to Raspbian 10 Buster is a relatively simple procedure. However, exercise caution, as there is always a chance to break the entire system. The fewer installed 3rd-party packages and services, the more likely you are able successfully to upgrade your Raspbian Linux system.

What’s New

  • UEFI Secure Boot
  • AppArmor enabled per default
  • Optional hardening of APT
  • Unattended-upgrades for stable point releases
  • Substantially improved man pages for German speaking users
  • Network filtering based on nftables framework by default
  • Cryptsetup defaults to on-disk LUKS2 format
  • driverless printing with CUPS 2.2.10
  • Basic support for Allwinner A64 based devices

SOURCE: debian.org

Raspberry Pi

Raspberry Pi

WARNING
Given that the Debian which is the Raspbian based on is an extremely robust Linux distribution, combined with the fact that there is nothing certain in life, the chances are, that after the upgrade you may end up with a broken system. Therefore, it is necessary to point out that no system upgrade is bulletproof and you should discuss, prepare and possibly test any proper fail-over or recovery process prior the proposed system upgrade to Debian Buster. For a more robust or production systems, you are recommended to read the official Debian upgrade guide before proceeding.

Recommendations

  • Remove unnecessary or obsolete packages
  • Make a data and configuration backup
  • Perform an upgrade directly using console
  • Check for any 3rd party software packages currently installed on your Raspbian system

Remove any obsolete standard repository and 3rd-party software before you attempt the upgrade. The aptitude command might help you to find any 3rd party software package currently installed on your Raspbian system.

# aptitude search '~i(!~ODebian)'

The above command will list all packages which are no longer in a standard repository list since they were removed; thus they were rendered obsolete, or the 3rd party packages which were installed manually.

Perform a full backup of data and manual configuration files residing on your current system. For example, these may include but not limited to user home directories, databases, websites, etc. Alternatively perform a complete Micro SD backup by using the dd command.

Fully Upgrade Current System

Start by fully upgrade your current Raspbian system before you proceed with a Buster upgrade.

# apt-get update
# apt-get upgrade

Upgrade any held back packages:

# apt-get dist-upgrade

System Check

Last, chance to check for any system inconsistencies. Perform database sanity and consistency checks for partially installed, missing and obsolete packages:

# dpkg -C

If no issues are reported, check what packages are held back:

# apt-mark showhold

Packages On Hold will not upgrade. On Hold packages may cause inconsistencies after Stretch upgrade. Before you move to the following part, it is suggested to fix all issues provided by both above commands.
The following command might be of a further assistance:

# dpkg --audit


Update Package Repository to Debian Buster

Next, update your /etc/apt/sources.list to include new Buster repositories.

# sed -i 's/stretch/buster/g' /etc/apt/sources.list

The above command will replace any stretch keyword occurrence to buster thus effectively enabling new Buster repositories. Once your /etc/apt/sources.list is updated to included Buster repositories, update your local package index with:

# apt-get update

Raspbian Buster Upgrade Simulation

Used the bellow command to see what we are facing. It is a simulated dry-run thus not system changes will be implemented.

# apt-get --simulate upgrade

Rasbian Buster Upgrade

We have come to the most exciting part, which is the actual Stretch upgrade to Raspbian Buster system. During the upgrade you may be asked:


There are services installed on your system which need to be restarted when certain libraries, such as libpam, libc, and libssl, are upgraded. Since these restarts may cause interruptions of service for the system, you will normally be prompted on each upgrade for the list of services you wish to restart. You can choose this option to avoid being prompted; instead, all necessary restarts will be done for you automatically so you can avoid being asked questions on each library upgrade.

Restart services during package upgrades without asking?
The choice is about whether you wish the system to restart your services automatically during the system upgrade or you wish to do it manually or after the system is fully upgrade to Buster realease.

When ready, execute the bellow commands to commence the Debian Buster upgrade process:

# apt-get upgrade
# apt-get dist-upgrade

All done. Reboot your system. Congratulations to your fully upgraded Raspbian 10 Buster Linux system.