Skip to content

Instantly share code, notes, and snippets.

@JuniYadi
Created October 31, 2024 03:07
Show Gist options
  • Save JuniYadi/1bfc48c484a48749f95c7909df587b1f to your computer and use it in GitHub Desktop.
Save JuniYadi/1bfc48c484a48749f95c7909df587b1f to your computer and use it in GitHub Desktop.
Upgrade Debian 11 to Debian 12
#!/bin/bash
apt update
apt upgrade -y
apt full-upgrade -y
apt --purge autoremove
cp -v /etc/apt/sources.list /root/sources.list-backup.11.bullseye
tee /etc/apt/sources.list > /dev/null << EOF
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main
deb-src http://deb.debian.org/debian bookworm-updates main
deb http://deb.debian.org/debian bookworm-backports main
deb-src http://deb.debian.org/debian bookworm-backports main
EOF
apt update
apt list --upgradable
apt upgrade --without-new-pkgs -y
apt full-upgrade -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment