Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the Dependencies

Install necessary dependencies to prepare a complete environment for compiling and installing MongoDB.

  • If the OS is CentOS 7.6, CentOS 8.1, or openEuler 20.03 and the installed MongoDB version is 3.6.13 or 4.0.12, run the following command to install the dependencies:
    1
    2
    cd ~
    yum -y install gcc gcc-c++ cmake wget net-tools libyaml python2 python2-setuptools libcurl-devel python2-devel gmp gmp-devel mpfr mpfr-devel libmpc libpcap net-tools
    

    Output for the start:

    Output for the end:

  • If the OS is openEuler 22.03 and the installed MongoDB version is 6.1.0, run the following command to install the dependencies:
    cd ~
    yum -y install gcc gcc-c++ cmake wget net-tools libyaml python3 python3-setuptools libcurl-devel python3-devel gmp gmp-devel mpfr mpfr-devel libmpc libpcap net-tools
    pip3 install jsonschema memory_profiler puremagic networkx cxxfilt requirements_parser
  • If the OS is openEuler 22.03 and the installed MongoDB version is 3.6.13 or 4.0.12, Python 2 and its management tools cannot be installed using a yum source because openEuler 22.03 has ceased support for Python 2. In this case, you need to manually compile and install Python 2 and its management tools. For details, see Installing Python Using the Source Code, Installing Setuptools Using the Source Code, and Installing pip Using the Source Code.

Installing Python Using the Source Code

  1. Download and decompress the Python source package.
    wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
    tar -zxvf Python-2.7.10.tgz
  2. Go to the decompressed Python source code directory.
    cd Python-2.7.10
  3. Run the configure script to set the Python installation path.
    ./configure --prefix=/usr/local/python-2.7.10
  4. Compile and install Python.
    make && make install

Installing Setuptools Using the Source Code

  1. Download the setuptools source package.
    wget https://files.pythonhosted.org/packages/b2/40/4e00501c204b457f10fe410da0c97537214b2265247bc9a5bc6edd55b9e4/setuptools-44.1.1.zip
  2. Decompress the setuptools source package.
    unzip setuptools-44.1.1.zip
  3. Go to the setuptools source code directory.
    cd setuptools-44.1.1
  4. Compile and install setuptools.
    python2 setup.py install

Installing pip Using the Source Code

  1. Download the pip source package.
    wget https://files.pythonhosted.org/packages/0b/f5/be8e741434a4bf4ce5dbc235aa28ed0666178ea8986ddc10d035023744e6/pip-20.2.4.tar.gz
  2. Decompress the pip source package.
    tar zxvf pip-20.2.4.tar.gz
  3. Go to the pip source code directory.
    cd pip-20.2.4
  4. Compile and install pip.
    python2 setup.py install