Issue
I'm following the official guide to install MongoDB Community Edition on Ubuntu.
After executing the commands step by step:
(1) Import the public key used by the package management system.
From a terminal, install gnupg and curl if they are not already available:
sudo apt-get install gnupg curl
To import the MongoDB public GPG key from https://pgp.mongodb.com/server-7.0.asc, run the following command:
curl -fsSL https://pgp.mongodb.com/server-7.0.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \ --dearmor
(2) Create a list file for MongoDB
Create the /etc/apt/sources.list.d/mongodb-org-7.0.list file for Ubuntu 22.04 (Jammy):
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.com/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
(3) Reload local package database
Issue the following command to reload the local package database:
sudo apt-get update
I'm getting the following error:
E: The repository 'https://repo.mongodb.com/apt/ubuntu jammy/mongodb-org/7.0 Release' does not have a Release file.
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.
Solution
The list file URL https://repo.mongodb.com/apt/ubuntu is invalid. It contains only the mongodb-enterprise
packages. You need to use https://repo.mongodb.org/apt/ubuntu to get the mongodb-org
community edition package.
Here is the corrected command for step (2) Create a list file for MongoDB:
echo "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" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
Answered By - Lukasz Wiktor Answer Checked By - Robin (WPSolving Admin)