OrangePi-PCを使ってみる

bullseyeからbookwormへ更新する

Debian 11(bullseye)からDebian 12(bookworm)への更新手順は色々なところで紹介されていますが、
Armbianを更新するページが無かったので紹介します。
こ ちらの記事が一番近いですが、それでも少し抜けている個所が有ります。
こちらの記事も参考にさせていただきま した。

こちらがDebian11(bullseye)をクリーンインストールした時の/etc/apt/sources.listです。
deb http://deb.debian.org/debian bullseye main contrib non-free
#deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
#deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
#deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

deb http://security.debian.org/ bullseye-security main contrib non-free
#deb-src http://security.debian.org/ bullseye-security main contrib non-free

こちらがDebian12(bookworm)をクリーンインストールした時の/etc/apt/sources.listです。
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://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

deb http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware
#deb-src http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware

bullseyeのアップデート

更新前にbullseyeを最新にしておきます。
$ sudo apt update

$ sudo apt upgrade

gpgvのインストール

apt は bookworm のリリース署名に使われている鍵を照合するのに gpgv バージョン 2 以降を必要とします。
適宜アップデートをしていればたぶん入ってると思いますが、一応、インストールコマンドを叩いておきます。
$ sudo apt install gpgv

アンインストールされたパッケージの設定ファイルの削除

以下のコマンドで設定ファイルをシステムに残して削除されたパッケージの一覧をリストしてくれます。
$ apt list '~c'

これらのパッケージをすっきり完全に削除したい場合は apt purge で削除できます。
$ sudo apt purge '~c'

不要な設定ファイルの削除

過去のアップグレードなどで生じた不要なデフォルトの設定ファイルを削除しておきます。
以下のコマンドを実行するとデフォルトの設定ファイルをリストしてくれます。
$ sudo find /etc -name '.dpkg-' -o -name '.ucf-' -o -name '*.merge-error'

/etc/apt/sources.listの書き換え

基本的にbullseyeをbookwormに変更するだけですが、Debian12ではnon-free-firmwareが追加されました。
変更後のファイルは以下の様になります。
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://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
#deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

deb http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware
#deb-src http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware

/etc/apt/sources.list.d/armbian.listの書き換え

bullseyeをbookwormに変更するだけです。
変更後のファイルは以下の様になります。
deb [arch=arm64 signed-by=/usr/share/keyrings/armbian.gpg] http://apt.armbian.com bookworm main bookworm-utils bookworm-desktop

アップデートの実行

変更するファイルは上記の2つだけです。
後はひたすらコマンドを実行します。
$ sudo apt update

$ apt upgrade --no-new-pkgs

$ apt full-upgrade

$ apt dist-upgrade

アップデートの確認

以下のコマンドでアップデートを確認します。
$ cat /etc/debian_version
12.8

後始末

以下のコマンドで未使用のパッケージを削除します。
$ sudo apt autoremove

続く...