Chromebook便利です
こんにちは。Chromebookを始めて購入してから、5年になりました。最初は、Chromebookらしい低スペックWebブラウジング 2 in 1 PCを使用していたのですが、あまりにも快適なのでメインの開発マシンもChromebookに3年前しました。
特に大きな不自由なく使用していたのですが、数ヶ月前から気になる現象が起こり始めたので記録に残しておきます。
環境
- HP Elite c1030 13.5 Chromebook
- ChromeOS 103.0.5060.64
- Debian 10
Debian 11へアップグレードできない
ChromeOSをアップグレードしていると「Linux環境(Debian10)もアップグレードできるよ」と通知が来るようになりました。言われるがままにアップグレードを実行しようとするものの、エラーにより実行できません。
最初は、ChromeOSのバグかな?と思って、アップデートを待っていたのですが、何度かアップデートが来ても解決されないので調査を始めました。
ログをみると、起こっているエラーは下記です。
W: GPG error: [package uri] [package name] InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY [key name]
E: The repository '[package uri] [package name] InRelease' is not signed.
[package uri]
, [package name]
, [key name]
にはそれぞれ別々のパッケージについてエラーが発生しています。
私の場合は、合計4個のパッケージにについて、これらのエラーが発生していました。
GPGエラー
調べてみると、GPGエラーとはGNU Privacy Guardの略で、Pretty Good Privacy (PGP) の別実装として、GPL に基づいた暗号化ソフト
とのこと。
--refresh-keysで一括更新を試みる
同様の症状をもっていた、下記Youtubeに従ってパブリックキーの更新を試みる。
$ sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
個別に鍵を指定して更新する
残念ながら上記方法ではうまくいかず、特に症状は前進しませんでした。
次に、エラー文に指定されているkey nameを用いて、個別に指定した更新を試みました。
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [key name]
この方法は成功し、公開鍵の更新に成功しました。
git-manのアップデートエラー
上記の問題を解決し、早速Debianのアップデートをもう一度試みると、今度は別のエラーが発生
The following packages were automatically installed and are no longer required:
git-man liberror-perl
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
git-man
debconf: delaying package configuration, since apt-utils is not installed
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1949 kB of archives.
After this operation, 338 kB of additional disk space will be used.
dpkg-deb: error: archive '/var/cache/apt/archives/git-man_1%3a2.37.0-0ppa1~ubuntu22.04.1_all.deb' uses unknown compression for member 'control.tar.zst', giving up
dpkg: error processing archive /var/cache/apt/archives/git-man_1%3a2.37.0-0ppa1~ubuntu22.04.1_all.deb (--unpack):
dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/git-man_1%3a2.37.0-0ppa1~ubuntu22.04.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
エラー前のログをよく読むとThe following packages were automatically installed and are no longer required
とのこと。もう必要無いモジュールなのに、そのアップデートができずにエラーになっている様子。
言われるがままに、削除するためのコマンドを実行
$ sudo apt autoremove
無事にアップグレード完了
上記実行後、再度Debianのアップグレードを実行。無事にエラーなく完了できました。
追記:Gitが消えている
上記コマンドでGitを削除してしまったようです。
$ sudo apt install git
上記を実行すると下記エラーが発生します。
The following packages have unmet dependencies:
git : Depends: libc6 (>= 2.34) but 2.31-13+deb11u3 is to be installed
E: Unable to correct problems, you have held broken packages.
どうやらlibc6というライブラリのバージョンが変わってしまったようです。
調べていくと、aptコマンドでの最新バージョンがUbuntu用の2.37がCandidateになっているため、libc6もより新しいバージョンを求められている模様。
$ apt-cache policy git
git:
Installed: (none)
Candidate: 1:2.37.0-0ppa1~ubuntu22.04.1
Version table:
1:2.37.0-0ppa1~ubuntu22.04.1 500
500 http://ppa.launchpad.net/git-core/ppa/ubuntu jammy/main amd64 Packages
1:2.30.2-1 500
500 https://deb.debian.org/debian bullseye/main amd64 Packages
1:2.20.1-2+deb10u3 -1
100 /var/lib/dpkg/status
Debian用の2.30をインストールしようとすると、git-man
もないとのこと。確かに、先程はあなたに苦しめられました。git-manもUbuntu用が入っているとのこと。Googleさんに言われてアップデートしたのになぜ…
$ sudo apt install git=1:2.30.2-1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
git : Depends: git-man (< 1:2.30.2-.) but 1:2.37.0-0ppa1~ubuntu22.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
git-manもDebian用をインストールします。
$ apt-cache policy git-man
git-man:
Installed: (none)
Candidate: 1:2.37.0-0ppa1~ubuntu22.04.1
Version table:
1:2.37.0-0ppa1~ubuntu22.04.1 500
500 http://ppa.launchpad.net/git-core/ppa/ubuntu jammy/main amd64 Packages
1:2.30.2-1 500
500 https://deb.debian.org/debian bullseye/main amd64 Packages
$ sudo apt install git-man=1:2.30.2-1
これでgitもインストールできるようになりました。
$ sudo apt install git
無事に問題解決です。