yum install mongodb on aws linux fails: no package available
amazon-web-services, linux, mongodb, yum
Solution
You don't need to create a new `/etc/yum.repos.d/mongodb.repo` or at the time of this answer `/etc/yum.repos.d/mongodb-org-3.6.repo` cause it already exists but it is empty.
You can check with: `cat /etc/yum.repos.d/mongodb-org-3.6.repo`.
all you need to do is open the file on vi editor:
$ sudo vi /etc/yum.repos.d/mongodb-org-3.6.repo
~
~
add this code to the repository file. The one i provided is for the MongoDB 3.6 but you can find the one for earlier versions in the documentation:
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
To save and exit from vi editor check here or go ahead and do this:
ESC + :wq
After that you can proceed with the steps in the documentation or in the old C9 Forum, but here they are just in case:
$ sudo yum install -y mongodb-org
$ sudo mkdir -p /data/db
$ echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"' > mongod
$ chmod a+x mongod
You can start mongodb by running the mongod script on your project root:
$ ./mongod
The last command might not run the mongodb local server, and you can find the solution for that here or just go ahead and run these two commands:
$ sudo service mongod stop
$ sudo mongod
Problem
Purpose I'm trying to install mongodb on EC2 AWS x86_64 GNU/Linux via Yum. Prerequisites I created a `/etc/yum.repos.d/mongodb.repo` file and tried all the available combinations for it's content found on the official documentations and on the related questions on stackoverflow link1 link2 link3, for example: ``` [mongodb-org-3.4] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc ``` (...tried with enabled=0, gpgcheck=0 too) I also added a `/etc/yum.conf` file like this: ``` [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3 ``` Problem I'm getting the same output when running `sudo yum install mongodb-org` (or by specifying the packages `sudo yum install mongo-org mongo-org-server` or by specifying the versions too `sudo yum install -y mongodb-org-3.2.13 mongodb-org-server-3.2.13 mongodb-org-shell-3.2.13 mongodb-org-mongos-3.2.13 mongodb-org-tools-3.2.13`) `Loaded plugins: priorities, update-motd, upgrade-helper amzn-main | 2.1 kB 00:00 amzn-updates | 2.3 kB 00:00 No package mongodb-org available. Error: Nothing to do` Question What am I missing? Is there any additional dependencies?