LoginSignup
68
39

More than 1 year has passed since last update.

【Tips】aptから入れたUbuntuのyarnが正しくupdateできないときの対応

Last updated at Posted at 2019-03-06

問題:sudo apt update

yarnをaptからインストールしたUbuntuでsudo apt updateしたときに公開鍵が云々言われてyarnが正しくアップデートされない。

入力

sudo apt update

出力


~~~【前略】~~~

Err:1 https://dl.yarnpkg.com/debian stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E

~~~【中略】~~~

Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
W: Some index files failed to download. They have been ignored, or old ones used instead.

日本語だとこちら。

W: 署名照合中にエラーが発生しました。リポジトリは更新されず、過去のインデックスファイルが使われます。GPG エラー: https://dl.yarnpkg.com/debian rc InRelease: 以下の署名が無効です: EXPKEYSIG ■■■■■■■■ Yarn Packaging <yarn@dan.cx>
W: https://dl.yarnpkg.com/debian/dists/rc/InRelease の取得に失敗しました  以下の署名が無効です: EXPKEYSIG ■■■■■■■■ Yarn Packaging <yarn@dan.cx>
W: いくつかのインデックスファイルのダウンロードに失敗しました。これらは無視されるか、古いものが代わりに使われます。

環境

  • Windows 10 Home 1809
    • Windows Subsystem for Linux (WSL)
      • Ubuntu 18.04.2 LTS
  • Lubuntu 18.04 LTS(上記日本語エラーメッセージ例)

WSL固有の症状ではなく、UbuntuもといDebian系共通の問題とのこと。

解決方法:キーの更新

キーが変わったとのことなので更新する。

入力

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

出力

OK

補足

年一ぐらいやってくれとのこと。

追記

2021年2月5日に遭遇した際のエラーメッセージは以下の通り。時期によって微妙に変わっている模様。環境は Windows 10 Home 2004 下の WSL においてインストールした Ubuntu 18.04LTS および 20.04LTS。

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx>
W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx>
W: Some index files failed to download. They have been ignored, or old ones used instead.

2023年2月28日現在、記事内同様の対応で解決可能であることを確認。

参考文献

68
39
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
68
39