Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

Linux/Ubuntu

Play this article
  • outline

Error occurs when you update list of ubuntu package for update.

  • error message
Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
  • situation
$ sudo apt-get update
Hit:1 https://apt.releases.hashicorp.com jammy InRelease
Ign:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 Release
Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
W: https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/6.0/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
  • resolution
$ sudo cd /etc/apt/
$ sudo cp trusted.gpg trusted.gpg.d/

$ sudo apt-get update
Hit:1 https://apt.releases.hashicorp.com jammy InRelease
Ign:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 Release
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:8 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:9 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done

$ apt list --upgradable
$ sudo apt update
$ sudo apt upgrade