2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Ubuntu: apt update を行った時の警告を消す

Last updated at Posted at 2023-02-11

sudo apt update を行った時の警告を消す方法です。
次のページを参考にしました。
Fixing "Key is stored in legacy trusted.gpg keyring" Issue in Ubuntu
Ubuntu 22.10 で確認しました。

警告のメッセージ

$ sudo apt update
(省略)
W: http://jp.archive.ubuntu.com/ubuntu/dists/kinetic/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://security.ubuntu.com/ubuntu/dists/kinetic-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://jp.archive.ubuntu.com/ubuntu/dists/kinetic-updates/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://jp.archive.ubuntu.com/ubuntu/dists/kinetic-backports/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

キーをリスト

$ sudo apt-key list
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2018-09-17 [SC]
      F6EC B376 2474 EDA9 D21B  7022 8719 20D1 991B C93C
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>

F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C
の最後の8桁をインポートに使います。
991BC93C

キーのインポート

sudo apt-key export 991BC93C | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/feb11.gpg

sudo apt update で警告が出ないことを確認

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?