Ask Your Question

want to create .repo

asked 2014-07-30 00:44:34 -0500

holevikrant gravatar image

updated 2014-07-30 07:31:54 -0500

FranciscoD_ gravatar image

want to create /etc/yum.repos.d/mongodb.repo for installing mongodb i am referring

edit retag flag offensive close merge delete



and what is the issue? you only need to create the file using vi or cat using information available in the page you mentioned.

tonioc gravatar imagetonioc ( 2014-07-30 04:42:35 -0500 )edit

Any terminal based text editor will work really. If you don't know how to use a terminal based text editor, I suggest you first google up and learn and then play with system configuration files.

FranciscoD_ gravatar imageFranciscoD_ ( 2014-07-30 07:33:29 -0500 )edit

Note that you must create the file as root. sudo vim /etc/yum.repos.d/mongodb.repo

bluestar gravatar imagebluestar ( 2014-07-30 16:38:13 -0500 )edit

BTW guys, the answer with commands etc. is right there on the webpage. Please close this.

abadrinath gravatar imageabadrinath ( 2014-07-31 01:15:01 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2014-07-30 02:00:00 -0500

abadrinath gravatar image

updated 2014-08-01 01:28:18 -0500

Please read the page for install mongodb. It says right there how to create the repo:

 Install MongoDB

 1 Configure the package management
 system (YUM). Create a
 /etc/yum.repos.d/mongodb.repo file to
 hold the following configuration
 information for the MongoDB

 If you are running a 64-bit system,
 use the following configuration:

 name=MongoDB Repository
 gpgcheck=0 enabled=1 

 If you are running a 32-bit system, which is not
 recommended for production
 deployments, use the following

 name=MongoDB Repository
 gpgcheck=0 enabled=1

To edit this file, execute su -c "gedit /etc/yum.repos.d/mongodb.repo" for GNOME, and su -c "kwrite /etc/yum.repos.d/mongodb.repo" for KDE. Then, you would copy and paste the bit above. Save, and you should be good to go.

A more automatic way to do this is this is here:

ru -c "echo -e "[mongodb]\nname=MongoDB Repository\nbaseurl=$(uname -p)/\n gpgcheck=0 enabled=1" >> /etc/yum.repos.d/mongodb.repo"

Please prompt root/admin password, and that's it. That should take care of everything for you. Just go, sudo yum install mongodb or similar after that.


Note: if this doesn't work for you, just do a google on 'adding repositories yum' ;)

edit flag offensive delete link more


@hello, please add a more detailed answer(don't just copy-paste what the site says). The user asks how to install/add this repository, and you need to consider that S/He don't even know how to open a text editor with root privileges. This is not bad, and it happens all the time. And please use an easy text editor. There is no need for vi , especially for newcomers (and I guess that our questioner here is one of them). Thanks

NickTux gravatar imageNickTux ( 2014-07-31 10:54:27 -0500 )edit

And something else, Offtopic, Are you realy the owner of ? :P

NickTux gravatar imageNickTux ( 2014-07-31 10:56:48 -0500 )edit

ok sure, edited.

abadrinath gravatar imageabadrinath ( 2014-08-01 01:14:53 -0500 )edit

@NikTh - yup, I'm the owner of :D

abadrinath gravatar imageabadrinath ( 2014-08-01 20:38:38 -0500 )edit

answered 2014-07-31 22:22:04 -0500

joseluisq gravatar image

Hi here the MongoDB shell Installer
Hope this helps you.


# Mongodb Shell 64-bit System Installer 
# OS: Red Hat Enterprise, CentOS or Fedora linux system.

# Miscellaneous
B=`tput bold`
N=`tput sgr0`

# Checks if package is installed on system
FILEPATH="`type -P mongod`"

# Define 64-bit system repo
name=MongoDB Repository

# Define repo file path

# Check if repo exists
if [ -z $FILEPATH ];
echo "${B}MongoDB Installer"
echo "Initializing the installation..."

# Save mongodb.repo on repos directory
sudo echo "${FILECONTENT}" > "${FILEPATH}"

# Install MongoDB on system via yum
sudo yum install mongodb-org

# Start MongoDB service
sudo service mongod start

# Add MongoDB for automatically boot time.
sudo chkconfig mongod on

echo "${B}MongoDB${N} has been installed successfully!"
echo "${B}MongoDB${N} is already installed!"
edit flag offensive delete link more


How about 32 bit repo?

abadrinath gravatar imageabadrinath ( 2014-08-01 01:27:41 -0500 )edit

And how the user could run this code, this installer ? Can you provide more details ? Thanks.

NickTux gravatar imageNickTux ( 2014-08-01 07:59:18 -0500 )edit

For 32bit systems change the baseurl to i686 repo url only, like so: baseurl=

joseluisq gravatar imagejoseluisq ( 2014-08-01 10:25:28 -0500 )edit

For run this shell code first save this code in some file for example then try this on your terminal: sudo sh

joseluisq gravatar imagejoseluisq ( 2014-08-01 10:32:06 -0500 )edit

@joseluisq - Please don't think I'm torturing you, but how would you save the code in the installer file? More details because some people are pretty new to linux.

abadrinath gravatar imageabadrinath ( 2014-08-01 22:03:56 -0500 )edit

answered 2014-08-02 07:25:40 -0500

Tiger gravatar image

if you want to make localrepo then try

[ Tiger ]

enjoy.... :)

edit flag offensive delete link more


Like I and @NikTh said to @joseluisq, add more details. How would you create the file? How do you edit the file? How would you install mongodb? And, BTW, that is not the repo for mongodb. Please add the repo for mongodb instead of yours. Thanks :D

abadrinath gravatar imageabadrinath ( 2014-08-02 21:04:38 -0500 )edit

Question Tools

1 follower


Asked: 2014-07-30 00:44:34 -0500

Seen: 1,924 times

Last updated: Aug 02 '14