#!/usr/bin/env bash if [ "$EUID" -ne 0 ]; then echo "Please run this script as root" exit fi # Change Buster release-info to oldstable apt update --allow-releaseinfo-change # Latest Buster updates apt update apt full-upgrade # Do NOT use rpi-update !! It installs dev-kernel. Use rpi-eeprom-update instead. # Switch to Bullseye... sed -i 's/buster/bullseye/g' /etc/apt/sources.list sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/* # In my case, /var was owned by unknown user, which causes systemd upgrade issues chown root:root /var # Action! apt update # Prerequisite packages apt install libgcc-8-dev gcc-8-base apt full-upgrade apt -f install dpkg --configure --pending apt full-upgrade # Remove obsolete packages apt autoremove # It seems the updater does not update the dhcpcd systemd unit file properly sometimes sed -i 's/ExecStart=\/usr\/lib\/dhcpcd5\/dhcpcd/ExecStart=\/sbin\/dhcpcd/' /etc/systemd/system/dhcpcd5.service systemctl daemon-reload # Upgrade to Nodejs 14.x: curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - apt install nodejs -y # Update RPI Firmware (Pi4, only. has some risk. Be warned) rpi-eeprom-update -d -a