Search code examples
linuxmongodbubuntuapt

mongodb Problem with apt update in ubuntu


I am facing this problem to update ubuntu and so far I tried different solutions to solve this problem but none of them could solve this problem.

N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.0 InRelease' is not signed.
E: Failed to fetch https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/4.0/InRelease  403  Forbidden [IP: 18.66.161.40 443]
E: Failed to fetch https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/5.0/InRelease  403  Forbidden [IP: 18.66.161.40 443]
E: The repository 'https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/7.0/InRelease  403  Forbidden [IP: 18.66.161.40 443]
E: The repository 'https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/7.0 InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

how i can solve this problems about mongodb!I had previously installed MongoDB to install an application and then uninstalled it.

regard


Solution

  • In my configuration I have a file

    /etc/apt/sources.list.d/mongodb-org-7.0.list

    which containes this entry (in signed-by there's a path to the key)

    deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse

    I added this key using the following commands:

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

    Did you tried this? I remember that there was a change in setting key for mongodb repos because apt-key is deprecated in the newest versions of Ubuntu