sudo apt update でエラー:W: GPG error: https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A26B1AE64C3C388 E: The repository 'https://repo.mongod

sudo apt update で下エラー

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release: The following signatures were invalid: EXPKEYSIG 68818C72E52529D4 MongoDB 4.0 Release Signing Key <packaging@mongodb.com>

W: GPG error: https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A26B1AE64C3C388
E: The repository 'https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 Release' is not signed.

solution)

必要のない古い list を削除

/etc/apt/sources-list.d/mongodb-org-4.0.list,  /etc/apt/sources-list.d/mongodb-org-4.0.list.save を削除

mongoDB6.0 の key を取得

curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
   --dearmor

 

ref: 

www.mongodb.com

 

sudo apt update >>> successfully updated