Setup MongoDB Environment on Fedora 37

Published on — Dec. 31, 2022
#fedora #mongodb

In 2018, MongoDB changed its license due to market demand. Fedora believes that this means it is no longer a pure free software (FOSS), so subsequent MongoDB releases are no longer included in official repositories. Until Fedora 30, the MongoDB server was completely removed.


I will not waste a single word judging those two organizations’ decisions; this article is written for people like me who have already wasted a lot of time setting up the environment.

Some of The Wrong Ways
  1. Try to install MongoDB for RHEL

    Unable to meet dependency needs

  2. Install .rpm packages directly

    nothing provides /usr/libexec/platform-python needed by …

The failure of these two methods is most likely due to the same reason: python2 is no longer supported since Fedora 30.

The Correct Solution

“My solution was to use MongoDB for Amazon Linux and use copr to satisfy the libcrypto and libssl dependencies.”

from StackOverflow by Pim Zandbergen

Here’s the steps:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
$ dnf copr enable dioni21/compat-openssl10

$ sudo echo "[mongodb-org-6.0]
  name=MongoDB Repository
  baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/6.0/x86_64/
  gpgcheck=1
  enabled=1
  gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
  " > /etc/yum.repos.d/mongodb-org-6.0.repo

$ sudo dnf update
$ sudo dnf install mongodb-org

$ sudo systemctl start mongod
$ sudo systemctl status mongod
$ sudo systemctl enable mongod

$ mongosh