Skip to content

Instantly share code, notes, and snippets.

@rrottmann
Last active November 8, 2025 16:48
Show Gist options
  • Select an option

  • Save rrottmann/b0f371a62950a9e149c4358772c5a647 to your computer and use it in GitHub Desktop.

Select an option

Save rrottmann/b0f371a62950a9e149c4358772c5a647 to your computer and use it in GitHub Desktop.
Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/bullseye-security bullseye-security/updates main
deb-src http://security.debian.org/bullseye-security bullseye-security/updates main
deb http://deb.debian.org/debian/ bullseye-updates main
deb-src http://deb.debian.org/debian/ bullseye-updates main
EOF
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 605C66F00D6C9793 6ED0E7B82643E131 0E98404D386FA1D9
apt-get clean
apt-get -y update
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
shutdown -r now
# Debian 11
cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bookworm main
deb-src http://deb.debian.org/debian/ bookworm main
deb http://security.debian.org/bookworm-security bookworm-security/updates main
deb-src http://security.debian.org/bookworm-security bookworm-security/updates main
deb http://deb.debian.org/debian/ bookworm-updates main
deb-src http://deb.debian.org/debian/ bookworm-updates main
EOF
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BDE6D2B9216EC7A8
apt-get clean
apt-get -y update
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
# issue with libcrypt.so.1
cd /tmp
apt -y download libcrypt1
dpkg-deb -x libcrypt1_1*a4.4.25-2_amd64.deb .
cp -av lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/
apt -y --fix-broken install
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
apt-get -y auto-remove
shutdown -r now
@bierdosenhalter
Copy link

gnupg was missing on debian 10 so the script failed on line 15

@werdender
Copy link

gnupg was missing on debian 10 so the script failed on line 15

Use hkp://keyserver.ubuntu.com:80 instead

@syswombat
Copy link

hello
why is this command needed?
apt-key adv --keyserver keyserver.ubuntu.com

@damianharouff
Copy link

Because, for the most part, people commenting on this gist have no idea what they're doing.

I've enjoyed being subscribed to it, and getting updates on it; it gives me a chuckle when I get an update every few months.

@vladipus
Copy link

if you're upgrading just now and should be using a Debian's archive you probably need these in your main /etc/apt/sources.list:

deb http://archive.debian.org/debian/ buster main
deb-src http://archive.debian.org/debian/ buster main

deb https://archive.debian.org/debian-security/ buster/updates main
deb-src https://archive.debian.org/debian-security/ buster/updates main

@vladipus
Copy link

deep into this I had to resort to using a Debian Live CD in order to copy the libcrypt.so.1.1.0 (along with creating symlinks to it) into the lib/x86_64-linux-gnu

otherwise I got the infamous sudo: account validation failure, is your account locked with the machine unusable

I think you should really correct the initial apt lists cause they seem to be indeed borked.

@nspassov
Copy link

nspassov commented Oct 29, 2025

Wow, the script worked flawlessly on a Contabo VPS. Thanks for sharing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment