(2025-12-07 初稿)
以下の記事では、Window11のWSL2のDebian Bullseye(11)からBookworm(12)にアップグレードする方法を術した。
Trixieになってかなり経つので、本記事では、WSL2のDebianをBookworm(12)からTrixie(13)へアップグレードする方法について記述する。
アップグレードの方法は、以下のサイトを参照するのが良いが、かなりていねいな記述なので、以下では筆者が実際に行った方法について記載する。
まずは、現在のバージョンを最新のものにしておく。
$ sudo apt update && sudo apt upgrade
/etc/apt/sources.listの更新
nanoやvi等で以下のとおりbookwormをtrixieへと変更。
deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware deb http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
パッケージリストの更新
$ sudo apt update
パッケージ更新のシミュレーション
以下は必須ではないが、心配な方は実行して、エラーがでるか確認すると良い。
$ sudo apt upgrade --simulate $ sudo apt full-upgrade --simulate
システムの最小アップグレード
$ sudo apt upgrade --without-new-pkgs
システムのアップグレード
$ sudo apt full-upgrade
不要なパッケージの削除
$ sudo apt autoremove --purge
システムの再起動
WSL2からexitで抜け、Powershell または terminal 等のアプリで、以下を実行。
> wsl --shutdown
単にPCを再起動しても可。
$ cat /etc/debian_version 13.2
WSLのアップグレードの参考になれば幸い。