Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB: installation error on amazon linux 2

I am trying to install mongodb 4 into an amazonlinux:2018.03 docker container. I followed these instructions. I managed to install only one package: mongodb-org, but I failed to install the rest of it: mongos, server, shell, tools.

The error I am give is the following:

Error: Package: mongodb-org-mongos-4.0.2-1.amzn2.x86_64 (mongodb-org-4.0) Requires: libc.so.6(GLIBC_2.18)(64bit)

There is a libc.so.6 in /lib64 pointing to /lib64/libc-2.17.so

Any help would be appreciated. Thank you.

like image 319
Bertie92 Avatar asked Sep 28 '18 17:09

Bertie92


2 Answers

It looks like you're using an AmazonLinux 2 MongoDB package within an AmazonLinux 1 container. You should try using the MongoDB 4.0.2 package for AmazonLinux 1.

like image 138
Matt Lord Avatar answered Oct 20 '22 06:10

Matt Lord


Cloud9 runs on the old Amazon linux instance, so you may run into this problem using the IDE. This is how I got it working for myself on Cloud9 running in an Amazon Linux instance:

File named "mongodb-org-4.2.repo"

[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc

Then I ran the following in the same directory as that file:

sudo cp ./mongodb-org-4.2.repo /etc/yum.repos.d/mongodb-org-4.2.repo
sudo yum install -y mongodb-org
like image 30
Erik Overflow Avatar answered Oct 20 '22 06:10

Erik Overflow