Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)
closed by

I used the following commands to install MongoDB on Fedora:

dnf config-manager --add-repo https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.0/x86_64/

dnf install mongodb-org

I got the following error: > warning:

 /var/cache/dnf/repo.mongodb.org_yum_redhat_7_mongodb-org_3.0_x86_64_-f13c178f04772646/packages/mongodb-org-3.0.12-1.el7.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 24f3c978: NOKEY The downloaded packages were saved in cache till the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: Public key for mongodb-org-3.0.12-1.el7.x86_64.rpm is not installed

Please help me with this.

closed

4 Answers

0 votes
by (13k points)
 
Best answer

The error you encountered during the installation of MongoDB on Fedora is due to the missing public key for the package "mongodb-org-3.0.12-1.el7.x86_64.rpm." To resolve this, you need to import the key by executing the command "rpm --import https://www.mongodb.org/static/pgp/server-3.0.asc". After importing the key, retry the installation command "dnf install mongodb-org," and the error should be resolved.

0 votes
by (11.7k points)
edited by

MongoDB is a document oriented data model which is free of cost, easy to use and open source database.

Commands to follow while installing:

# dnf install mongodb mongodb-server

# service mongod start

Specific versions of MongoDB can also be installed. For that configuration of the package management system is needed. By default, DNF uses the global configuration file at /etc/dnf/dnf.conf and all *.repo files found under /etc/yum.repos.d.

In order to have the access of directory and and to create a file mongodb-org-release_series.repo

$ cd /etc/yum.repos.d/

$ sudo touch mongodb-org-4.0.repo 

Copy and paste this entire content inside the mongodb-org-release_series.repo, you can also make changes if you want to install another version. 

[Mongodb]

name=MongoDB Repository

baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/

gpgcheck=1

enabled=1

gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

Now MongoDB can be installed using DNF

$ sudo dnf install -y mongodb-org

Now, if you want to run MongoDB, start MongoDB services and test the connection by running mongoshell. 

$ sudo service mongod start

$ mongo

0 votes
by (11.4k points)
The first command you used, "dnf config-manager --add-repo https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.0/x86_64/", adds the MongoDB repository to the DNF package manager on Fedora.

The second command, "dnf install mongodb-org", attempts to install MongoDB using the DNF package manager.

The error message you received indicates that there is a problem with the public key for the package "mongodb-org-3.0.12-1.el7.x86_64.rpm." This error occurs when the package manager cannot verify the authenticity and integrity of the package.

To resolve this issue, you need to import the public key for the MongoDB repository. You can do this by executing the following command: "rpm --import https://www.mongodb.org/static/pgp/server-3.0.asc". This command imports the public key used to sign the MongoDB packages.

After importing the key, you can retry the installation command "dnf install mongodb-org", and it should proceed without the "Public key not installed" error.

In summary, the error occurred because the public key for the MongoDB package was missing. By importing the key using the provided command, you should be able to install MongoDB successfully on your Fedora system.
0 votes
by (7.8k points)
Import the MongoDB repository's public key by running "rpm --import https://www.mongodb.org/static/pgp/server-3.0.asc" to resolve the "Public key not installed" error during installation on Fedora.

Related questions

0 votes
4 answers
0 votes
1 answer
asked Feb 20, 2021 in SQL by rahulnayar01123 (6.1k points)
0 votes
1 answer
asked Feb 15, 2021 in Linux by rahulnayar01123 (6.1k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...