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 で警告が出ないことを確認