MongoDB GPG - Invalid Signatures

后端 未结 11 1334
半阙折子戏
半阙折子戏 2020-12-04 06:46

I\'m installing MongoDB on an Ubuntu 14.04 machine, using the instructions at: https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

So I run:

11条回答
  •  感情败类
    2020-12-04 07:43

    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 
    

    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
    

提交回复
热议问题