Skip to content

upgrade from 11 to 12

Table of Content

upgrade from 11 to 12

work log

Upgrade work log on debian 11 k8s worker node.

# on control plane
kubectl drain --ignore-daemonsets --delete-emptydir-data ak3v

# on the worker node
sudo apt list '?narrow(?installed, ?not(?origin(Debian)))'

sudo apt-mark showhold
sudo apt-mark unhold kubeadm kubectl kubelet

sudo apt remove cri-tools docker-buildx-plugin docker-ce-cli docker-ce-rootless-extras docker-ce docker-compose-plugin kubeadm kubectl kubelet kubernetes-cni

sudo rm /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/kubernetes.list

sudo apt update && sudo apt upgrade -y
sudo apt full-upgrade
sudo apt --purge autoremove

# install gpgv required to install d12
sudo apt install gpgv

# backup apt sources.list
sudo cp /etc/apt/sources.list ~/sources.list.bak

# edit sources.list
# basically just change anything previous to "bookworm"
# example) deb bookworm main

# start recording session
script -t 2>~/upgrade-bookwormstep.time -a ~/upgrade-bookwormstep.script

# review the recording later
# scriptreplay ~/upgrade-bookwormstep.time ~/upgrade-bookwormstep.script

# update packages
sudo apt update

# minimal upgrade first
sudo apt upgrade --without-new-pkgs
# gets asked to restart service, answer yes
# asked how to deal with sudoer conf file, keep the existing one, confirm the msg to be sure, but default N should be fine

# full upgrade
sudo apt full-upgrade

# confirm if there is a kernel metapackage installed
sudo dpkg -l 'linux-image*' | grep ^ii | grep -i meta
# if not present, see 4.6.1. Installing a kernel metapackage

sudo reboot