IT story

MongoDB GPG-유효하지 않은 서명

hot-time 2020. 9. 12. 11:32
반응형

MongoDB GPG-유효하지 않은 서명


https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ 의 지침을 사용하여 Ubuntu 14.04 시스템에 MongoDB를 설치하고 있습니다.

그래서 나는 다음을 실행합니다.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

그리고:

echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

뒤에 :

sudo apt-get update

그런 다음 업데이트가 끝날 때 다음 경고가 표시됩니다.

W : GPG 오류 : http://repo.mongodb.org trusty / mongodb-org / 3.2 릴리스 : 다음 서명이 유효하지 않습니다. BADSIG D68FA50FEA312927 MongoDB 3.2 릴리스 서명 키

경고를 무시하고 실행하려고하면 :

sudo apt-get install -y mongodb-org

나는 얻다:

경고 : 다음 패키지는 인증 할 수 없습니다!
mongodb-org-shell mongodb-org-server mongodb-org-mongos mongodb-org-tools mongodb-org E : 문제가 있으며 --force-yes없이 -y를 사용했습니다.

해결 방법에 대한 아이디어가 있습니까? 감사!


하나의 명령으로 Ubuntu 키 서버에서 만료 된 모든 키를 업데이트합니다.

sudo apt-key list | \
 grep "expired: " | \
 sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \
 xargs -n1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys

명령 설명 :

  1. sudo apt-key list -시스템에 설치된 모든 키를 나열합니다.
  2. grep "expired: " -만료 된 키가있는 줄만 남깁니다.
  3. sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' -키 추출;
  4. xargs -n1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys -만료 된 항목을 발견하여 Ubuntu 키 서버에서 키를 업데이트합니다.

출처


MongoDB의 설치 단계를 다시 실행해야하는 것 같습니다. 먼저 MongoDB의 기존 저장소 파일을 제거하십시오. 아래와 같이하십시오.

$ sudo rm /etc/apt/sources.list.d/mongodb*.list

다음으로 키를 추가합니다 (키가 없으면 저장소가로드되지 않음).

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927

이제 새 MongoDB 저장소 목록 파일을 만듭니다.

$ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

저장소 세부 정보를 추가 한 후 패키지 목록을 업데이트해야합니다.

$ sudo apt-get update

이제 MongoDB를 설치하십시오.

sudo apt install mongodb-org

도움이 되었기를 바랍니다 !


mongo 패키지를 다시 설치할 필요는 없지만 다음과 같이 키를 변경하면됩니다.

만료되었는지 확인하기 위해 키를 나열합니다.

apt-key list | grep "expired:"

키 교체 :

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xd68fa50fea312927

0xd68fa50fea312927은 현재 유효한 키 ID입니다 (2019-10-09에 만료 됨) . 여기에서 확인할 수 있습니다 .


It seems version 3.2.1 has been released on 11/Jan/2016, and the packages signature is bad since this moment. The packages signature were fine the day before.

refs: https://jira.mongodb.org/browse/SERVER/fixforversion/15908/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-summary-panel

You can either add the --force-yes option, or wait for a few hours that the mongodb team sees and fixes the issue.

There is already a ticket there: https://jira.mongodb.org/browse/SERVER-22144


I also faced this issue when installing MongoDB 3.2 on my ubuntu 16.04 using the below commands. The below solution is provided as the question related to the v3.2 installation of MongoDB

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update

After running the above update command i found the following warnings

W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release: The following signatures were invalid: KEYEXPIRED 1507497109
W: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

On further investigating using the below command to list all the keys

sudo apt-key list

It shows that the current key is expired on 2017-10-08

pub   4096R/EA312927 2015-10-09 [expired: 2017-10-08]
uid                  MongoDB 3.2 Release Signing Key <packaging@mongodb.com>

This also made sense as the MongoDB Current Stable Release is now (3.4.9).

To fix the issue first we make a small cleanup (optional)

  1. we remove the old key added

    sudo apt-key list // List all keys

    sudo apt-key del EA312927 // Find the uid of the key to be deleted

    apt-key list | grep Mongodb // Verify if its deleted

  2. Now we remove the MongoDB repo added in /etc/apt/sources.list.d

    sudo rm /etc/apt/sources.list.d/mongodb*.list

  3. Now we install the latest stable version of MongoDB(3.4.9) using below commands

Import the Public Key used by the Ubuntu Package Manager

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

Create a file list for mongoDB to fetch the current repository

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-3.4.list

Install MongoDB

sudo apt-get update
sudo apt-get install mongodb-org

I had the same problem, and solved it by installing mongodb with tarball method. Refer to the below link for detail.

https://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/

Adding details below

  1. curl -O https://fastdl.mongodb.org/linux/mongodb-linux-i686-3.2.0.tgz
  2. tar -zxvf mongodb-linux-i686-3.2.0.tgz
  3. mkdir -p mongodb && cp -R -n mongodb-linux-i686-3.2.0/ mongodb
  4. export PATH=/bin:$PATH

  5. then run mongod (db path might needs to be set)


I also faced this issue when installing MongoDB 4.0 on Ubuntu 16.04. So I did.

  1. sudo rm /etc/apt/sources.list.d/mongodb*.list - remove any existing file for MongoDB

  2. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E52529D4 - add the key

  3. sudo bash -c 'echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-4.0.list' - create a new MongoDB repository list file

Now, Complete the installation with an update of repositories then install MongoDB, enable the mongod service and start it up, and last, check your MongoDB version:

sudo apt update
sudo apt install mongodb-org

systemctl enable mongod.service
systemctl start mongod.service

mongo --version

I had the same problem, so I did:

root@skarabi:~# apt remove mongodb-org

Then:

root@skarabi:~# sudo rm /etc/apt/sources.list.d/mongodb*.list

After :

root@skarabi:~# apt update


Actually, the following is very important to solve the problem

$ sudo rm /etc/apt/sources.list.d/mongodb*.list

참고URL : https://stackoverflow.com/questions/34733340/mongodb-gpg-invalid-signatures

반응형