How to install mongoDB on Fedora

fedoramongodb

I want to install mongodb on fedora 25,

but i get this error :

Redirecting to '/usr/bin/dnf install -y mongodb-org' (see 'man yum2dnf')

Failed to synchronize cache for repo 'mysql57-community', disabling.
Failed to synchronize cache for repo 'mongodb-org-3.4', disabling.
Failed to synchronize cache for repo 'mysql-connectors-community', disabling.
Failed to synchronize cache for repo 'mysql-tools-community', disabling.
Last metadata expiration check: 1:58:49 ago on Thu Feb 16 12:55:42 2017.
No package mongodb-org available.
Error: Unable to find a match.

Best Answer

You are probably using this repository

[mongodb-org-3.4]
name=MongoDB 3.4 Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=0
enabled=1

It doesn't work on Fedora for two reasons:

  • This repository is only for RHEL or CentOS 6/7
  • $releasever should be 6 or 7 (and not 25+)

If you want to install mongo (v3.4 on February 2018) in fedora, you can use the normal repository:

# As ROOT
# Install the client and the server
dnf install mongodb mongodb-server

# If you have SELinux
# Allow access to port 27017 (the one mongo server uses)
semanage port -a -t mongod_port_t -p tcp 27017

# Start mongo server 
systemctl start mongod

# From any user
# You can access the client
mongo 

Source: