Whilst the accepted answer by Michael Hampton may have been accurate at the time of answering, EPEL has been available for EL8 for a while:
$ sudo rpm -q --changelog epel-release | awk '/8-7/,/8-1/'
* Thu Oct 10 2019 Stephen Smoogen <[email protected]> - 8-7.el8
- Remove failovermethod from EPEL8 tree. It is no longer needed.
* Mon Sep 16 2019 Stephen Smoogen <[email protected]> - 8-6.el8
- Change gpg key to use -8 versus -$releasever. This fixes bash problem
* Tue Aug 06 2019 Stephen Smoogen <[email protected]> - 8-5.el8
- Fix playground release to have os/ on its name [Kevin Fenzi]
- Make sure all values of $release are $releasever
* Thu Aug 01 2019 Pablo Greco <[email protected]> - 8-4
- Use the correct var for dnf to expand
- Update playground source url
- Remove epel-modules repo
- Use https in baseurl
* Thu Aug 01 2019 Stephen Smoogen <[email protected]> - 8-3
- Make sure that the key name is named correctly
* Thu Aug 01 2019 Stephen Smoogen <[email protected]> - 8-2
- Make baseurl paths match dl.fedoraproject.org
- Add draft of epel8 packaging
- Fix docs
* Thu Jul 18 2019 Stephen Smoogen <[email protected]> - 8-1
If you use the MongoDB YUM repository then you will have 4.2 available for EL8 (note this adds in version numbering to the repo ID):
[mongodb-org-4.2]
name=MongoDB Repository 4.2
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
[mongodb-org-4.0]
name=MongoDB Repository 4.0
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=0
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
If you attempt to use the repo file with EL8 for 4.0 then you will see:
$ sudo dnf makecache --disablerepo="*" --enablerepo=mongodb-org-4.0
MongoDB Repository 4.0 369 B/s | 390 B 00:01
Error: Failed to synchronize cache for repo 'mongodb-org-4.0'
Using verbose mode you can see a hint of what is wrong (there is no 4.0 repo for EL8):
$ sudo dnf makecache --verbose --disablerepo="*" --enablerepo=mongodb-org-4.0
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.0.9
cachedir: /var/cache/dnf
Unknown configuration value: failovermethod=priority in /etc/yum.repos.d/puppet5.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Making cache files for all metadata files.
mongodb-org-4.0: has expired and will be refreshed.
repo: downloading from remote: mongodb-org-4.0
MongoDB Repository 4.0 367 B/s | 390 B 00:01
Cannot download 'https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.0/x86_64/': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
Error: Failed to synchronize cache for repo 'mongodb-org-4.0'
According to MongoDB's Jira (SERVER-37772), marked as resolved at Jul 29 2019 05:48:23 PM GMT+0000, backports have been requested for EL8 packages for earlier versions on MongoDB, but they are not showing in the repo yet:
Note that from the MongoDB download page, selecting rhel80x64 produces:
So, you can use EL8 with 4.2, or you need to use EL7 for a previous MongoDB release version, at least for now, or you can use Percona's distribution:
sudo dnf clean all
sudo dnf rm -r /var/cache/dnf
sudo dnf upgrade
--verbose
as it may show you something. Also, the config online now uses HTTPS.