Setup/1_TrixieUpgrade.sh

41 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Root-Rechte prüfen
if [ "$(id -u)" -ne 0 ]; then
echo "❌ Bitte als root ausführen!"
exit 1
fi
# Sicherheitsabfrage
read -p "⚠️ Achtung! Du führst ein Release-Upgrade auf Debian Trixie durch. Fortfahren? (ja/nein): " answer
answer=${answer,,} # In Kleinbuchstaben umwandeln
answer=${answer:-n} # Standardwert 'n', falls leer
if [[ "$answer" != "j" ]] || [[ "$answer" != "y" ]]; then
echo "❌ Upgrade abgebrochen."
exit 0
fi
echo " Aktualisiere Paketlisten..."
sudo apt-get update
echo " Starte System-Upgrade..."
sudo apt-get full-upgrade -y
echo " Ändere die Paketquellen auf Debian Trixie..."
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
echo " Aktualisiere Paketlisten erneut..."
sudo apt-get update
echo " Starte vollständiges Release-Upgrade..."
sudo apt-get full-upgrade -y
read -p "❓ Drücke [ENTER], um das System jetzt neuzustarten."
echo " System wird jetzt neu gestartet..."
sudo reboot