4

I need to install MongoDB community edition on an Amazon Linux machine.

I followed the steps described in the MongoDB documentation that are, very simply:

  1. Create the repo file in /etc/yum.repos.d
  2. Intall via sudo yum install -y mongodb-org

However, I get a dependency error that I cannot go past. Here's the output:

sh-4.2$ sudo yum install -y mongodb-org
Loaded plugins: dkms-build-requires, priorities, update-motd, upgrade-helper, versionlock
amzn-main                                                                                     | 2.1 kB  00:00:00     
amzn-updates                                                                                  | 2.5 kB  00:00:00     
libnvidia-container/x86_64/signature                                                          |  455 B  00:00:00     
libnvidia-container/x86_64/signature                                                          | 2.0 kB  00:00:00 !!! 
mongodb-org-4.2                                                                               | 2.4 kB  00:00:00     
Not using downloaded repomd.xml because it is older than what we have:
  Current   : Mon Dec  9 22:52:43 2019
  Downloaded: Mon Dec  9 22:52:27 2019
nvidia-container-runtime/x86_64/signature                                                     |  455 B  00:00:00     
nvidia-container-runtime/x86_64/signature                                                     | 2.0 kB  00:00:00 !!! 
nvidia-docker/x86_64/signature                                                                |  455 B  00:00:00     
nvidia-docker/x86_64/signature                                                                | 2.0 kB  00:00:00 !!! 
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: mongodb-org-tools = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-shell = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-server = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Processing Dependency: mongodb-org-mongos = 4.2.2 for package: mongodb-org-4.2.2-1.amzn2.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.18)(64bit) for package: mongodb-org-mongos-4.2.2-1.amzn2.x86_64
---> Package mongodb-org-server.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.18)(64bit) for package: mongodb-org-server-4.2.2-1.amzn2.x86_64
---> Package mongodb-org-shell.x86_64 0:4.2.2-1.amzn2 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.18)(64bit) for package: mongodb-org-shell-4.2.2-1.amzn2.x86_64
---> Package mongodb-org-tools.x86_64 0:4.2.2-1.amzn2 will be installed
--> Finished Dependency Resolution
Error: Package: mongodb-org-shell-4.2.2-1.amzn2.x86_64 (mongodb-org-4.2)
           Requires: libc.so.6(GLIBC_2.18)(64bit)
Error: Package: mongodb-org-mongos-4.2.2-1.amzn2.x86_64 (mongodb-org-4.2)
           Requires: libc.so.6(GLIBC_2.18)(64bit)
Error: Package: mongodb-org-server-4.2.2-1.amzn2.x86_64 (mongodb-org-4.2)
           Requires: libc.so.6(GLIBC_2.18)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

In addition, when I run yum whatprovides */libc.so.6, I understand that that file is already installed on the machine:

Loaded plugins: dkms-build-requires, priorities, update-motd, upgrade-helper, versionlock
libnvidia-container                                                                                            40/40
nvidia-container-runtime                                                                                       18/18
nvidia-docker                                                                                                  14/14
mongodb-org-4.2/filelists_db                                                                  | 2.8 kB  00:00:00     
glibc-2.17-196.172.amzn1.i686 : The GNU libc libraries
Repo        : amzn-main
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-196.172.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-main
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-222.173.amzn1.i686 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-222.173.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-260.175.amzn1.i686 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-260.175.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-292.178.amzn1.i686 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib/i686/nosegneg/libc.so.6
Filename    : /lib/libc.so.6



glibc-2.17-292.178.amzn1.x86_64 : The GNU libc libraries
Repo        : amzn-updates
Matched from:
Filename    : /lib64/libc.so.6



glibc-2.17-292.178.amzn1.x86_64 : The GNU libc libraries
Repo        : @amzn-updates
Matched from:
Filename    : /lib64/libc.so.6

Hence, what should I do to overcome this obstacle?

2
  • Try doing a yum -y update first.
    – schaiba
    Jan 10, 2020 at 11:24
  • 2
    The glibc version not match, you have 2.17 but the package you are installing requires 2.18. Seems that you setup a mongodb repository for Amazon Linux 2 but you have an Amazon Linux 1. Jan 10, 2020 at 12:41

1 Answer 1

4

This is because you are using Amazon Linux 1 -- i.e. Amazon Linux (2013.03+) which supports up to GLIBC_2.17. For GLIBC_2.18, use Amazon Linux 2 AMI and configure repo for installing mongo. Configure the proper repo and reinstall the package. Below are the link for both: https://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-amazon/

1
  • that was exactly it. thanks
    – Amirsalar
    Nov 3 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .