Skip to content

Instantly share code, notes, and snippets.

@rrottmann
Created August 20, 2023 12:29
Show Gist options
  • Save rrottmann/b0f371a62950a9e149c4358772c5a647 to your computer and use it in GitHub Desktop.
Save rrottmann/b0f371a62950a9e149c4358772c5a647 to your computer and use it in GitHub Desktop.
Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade
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/debian-security stable-security/updates main
deb-src http://security.debian.org/debian-security stable-security/updates main
deb http://deb.debian.org/debian/ bullseye-updates main
deb-src http://deb.debian.org/debian/ bullseye-updates main
EOF
apt-get clean
apt-get -y update
apt-get -y upgrade
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/debian-security stable-security/updates main
deb-src http://security.debian.org/debian-security stable-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
apt-get -y full-upgrade
# issue with libcrypt.so.1
cd /tmp
apt -y download libcrypt1
dpkg-deb -x libcrypt1_1%3a4.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
apt-get -y full-upgrade
apt-get -y auto-remove
shutdown -r now
@rrottmann
Copy link
Author

AFAIK apt-get -y upgrade only updates existing packages without removing installed packages or installing new dependencies. That way I want to make sure to install the latest bug fixes of the existing tooling. apt-get -y full-upgrade then is more invasive, as it also might install new packages or remove packages in the process.

@johannesobier
Copy link

johannesobier commented May 30, 2024

Modified one little detail:
Instead of
apt-get -y upgrade
I used
apt-get -y upgrade --without-new-pkgs

Otherwise I always got problems of type "broken dependencies"

But overall I'm very happy I found your Gist. Thanks!

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