MongoDB 4 Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Package installation

The MongoDB packages available for RHEL/Fedora/CentOS are exactly the same as those described in preceding sections for Debian/Ubuntu. Also, as described earlier, a composite package called mongodb-org that contains all four packages is available. Because RHEL/Fedora/CentOS packages use RPM for packaging, the tool of choice for installation, updating and management of packages is yum (Yellowdog Updater, Modified).

To install MongoDB on RHEL/Fedora/CentOS Linux distributions, proceed as follows:

  1. Create a repository file for yum in the /etc/yum.repos.d directory. The filename should be like this, mongodb-org-X.Y.repo, where X is the major version number for MongoDB, and Y is the minor release. As an example, for MongoDB version 4.0, the current version as of this writing, the filename would be:
    /etc/yum.repos.d/mongodb-org-4.0.repo:

  1. Install the composite package using: sudo yum install -y mongodb-org: