treedown’s Report

システム管理者に巻き起こる様々な事象を読者の貴方へ報告するブログです。会社でも家庭でも"システム"に携わるすべての方の共感を目指しています。

※https化しました。その影響でしばらくリンク切れなどがあるかもしれませんが徐々に修正していきます。 リンク切れなどのお気づきの点がございましたらコメントなどでご指摘いただけますと助かります。

テスト環境でDebian10⇒11アップグレードの確認・テスト

本番環境で利用しているDebianのアップグレード前にテスト環境で動作を調査する目的。
テスト環境で、Debianのメジャーバージョンbusterからbullseyeへのアップグレードをやってみたのでご報告です。

情報収集

作業前に

■Debian 11 (bullseye) リリースノート (64 ビット PC 用)の第4章 Debian 10 (buster) からのアップグレード
https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.ja.html

にある公式の情報を読んでおくようにします。
※これ以降、文中の「公式の」とある抜粋は上記URLからの抜粋になります。

既存のアップデートを全て適用しておく

恒例ですが、busterのアップデートは全て適用して最新状態にしておきます。

 #  sudo apt update
 #  sudo apt upgrade
 #  sudo apt dist-upgrade
 #  sudo apt autoremove

apt update中に出てくる下記(のような)メッセージ(複数回表示)は
--------------------------------------------------------------
E: Repository 'http://ftp.jp.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N] y
--------------------------------------------------------------
Debian buster(10)が'stable-updates'から 'oldstable-updates'に変更されたためにメッセージが表示されます。
メッセージには「このリポジトリの更新を適用する前に、これを明示的に受け入れる必要があります。」とあるので、yを指定して、変更を受け入れます。

upgradeで
--------------------------------------------------------------
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
アップグレードパッケージを検出しています... 完了
アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 0 個。
--------------------------------------------------------------
ここまで進めます。

source-list ファイルの変更

次にいつものsource-listファイルの変更を実施します。(いつもと違ったので詳細を記述)

f:id:treedown:20210916164323p:plain

--------------------------------------------------------------
$ cat /etc/apt/sources.list
#

# deb cdrom:[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07]/ buster main

#deb cdrom:[Debian GNU/Linux 10.1.0 _Buster_ - Official amd64 NETINST 20190908-01:07]/ buster main

deb http://ftp.jp.debian.org/debian/ buster main
deb-src http://ftp.jp.debian.org/debian/ buster main

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

# buster-updates, previously known as 'volatile'
deb http://ftp.jp.debian.org/debian/ buster-updates main
deb-src http://ftp.jp.debian.org/debian/ buster-updates main

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
--------------------------------------------------------------
これを(※コメント行は抜きで)書き換えていくわけですが
--------------------------------------------------------------
deb http://ftp.jp.debian.org/debian/ bullseye main
deb-src http://ftp.jp.debian.org/debian/ bullseye main

deb http://security.debian.org/debian-security bullseye/updates main
deb-src http://security.debian.org/debian-security bullseye/updates main

deb http://ftp.jp.debian.org/debian/ bullseye-updates main
deb-src http://ftp.jp.debian.org/debian/ bullseye-updates main
--------------------------------------------------------------
と、このように従来のようにただ書き換えるだけでは今回作業が足りなくて、
"http://security.debian.org/debian-security"の行にある、
「bullseye/updates main」と指定の箇所は
「bullseye-security main」と書き換える必要があります。

公式(前述のURL)にも(以下抜粋)
--------------------------------------------------------------
4.2.7. セキュリティセクション
セキュリティアーカイブを参照する APT ソース行では、フォーマットが buster/updates から bullseye-security へリリース名と一緒に少し変更されています。「セキュリティアーカイブの構成が変更されました」 を参照ください。
--------------------------------------------------------------
■参考URL:セキュリティアーカイブの構成が変更されました
https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.ja.html#security-archive
--------------------------------------------------------------
と記載があります。
ちなみに(脱線ですが)上記のページに気になる記述を見つけましたので、メモ。
--------------------------------------------------------------
5.1.7. 非推奨になる rsync のパラメータ
rsync のパラメータ --copy-devices と --noatime が --write-devices と --open-noatime に変更されました。古い書式のパラメータはサポートされません。これらのパラメータを使用している場合、NEWS ファイルに目を通すのをお勧めします。 異なる Debian のリリースが稼動しているシステム間で通信する場合は、buster 側の rsync を backports のバージョンにアップグレードする必要があるかもしれません。
--------------------------------------------------------------
あとで使う情報だから覚えておきます。

脱線から話が戻りまして、参考までにDebian bullseyeの標準のsources.listファイルの内容がこれでした。
--------------------------------------------------------------
$ cat /etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 NETINST 20210814-10:07]/ bullseye main

#deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 NETINST 20210814-10:07]/ bullseye main

deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main

deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main

# bullseye-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ bullseye-updates main
deb-src http://deb.debian.org/debian/ bullseye-updates main

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
--------------------------------------------------------------

busterでは「ftp.jp.debian.org」だった箇所が、bullseyeでは「deb.debian.org」に変わっているのが見て取れます。

実際のアップグレード

sources.listの編集が完了したらいよいよアップグレードを実行します。

いままで、apt updateからapt dist-upgradeだったのですが、どうやら公式によれば、そうではないらしいです。

まずはシステムの最小アップグレードを、
# apt update
# apt upgrade --without-new-pkgs
で実行、その次にシステム全体のアップグレードである
# apt full-upgrade
を実行する、という2段階でアップグレードを完了させるようです。
full-upgradeを実行すると残しておきたいパッケージが大量に削除されるケースがあるとのこと、まずはアップグレードしても他のパッケージを入れたり消したりする必要がないパッケージをアップグレードし、アップグレードの主要な部分を後から実行することで、完全なアップグレードが完了するようです。

早速実行してみます。

「apt upgrade --without-new-pkgs」で最小アップグレード

f:id:treedown:20210916165207p:plain

無事完了。

f:id:treedown:20210916165218p:plain

ここから、次に「apt full-upgrade」を実行して、

f:id:treedown:20210916165230p:plain

全体のアップグレードを実行します。

f:id:treedown:20210916165240p:plain

完了しました。
OSのバージョンを確認してみると、
VERSION_ID="11"
VERSION="11 (bullseye)"
とか、「/etc/debian_version」のバージョン番号が、
11.0
と表示されるようになっていました。

f:id:treedown:20210916165258p:plain

これでバージョンアップはぶじ完了したようです。

完了後に、不要パッケージがリストアップされますので、

f:id:treedown:20210916165314p:plain「apt autoremove」を実行して、不要パッケージを削除し領域を開放します。

再起動後

ログイン画面がbuster(MATE)だったのですが、bullseyeで使われている壁紙に変更されました。

f:id:treedown:20210916165338p:plain

バージョンアップで特に消えているものもないようで、無事起動してきました。
動作確認はこれからですが、テスト環境では特に問題はないようでした。