title: Errors while installing mongo db
body: <p>I belong to a IT support team and i have the duty of installing mongodb in my organization so while trying to install mongodb on systems(fresh/not used ) sometimes mongo gets installed directly but majority of the times i am getting this error</p>
  
  <p>root@goutham:mongo
  MongoDB shell version: 3.0.12
  connecting to: test
  2016-05-30T02:57:07.910-0400 W NETWORK  Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
  2016-05-30T02:57:07.915-0400 E QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
      at connect (src/mongo/shell/mongo.js:179:14)
      at (connect):1:6 at src/mongo/shell/mongo.js:179
  exception: connect failed</p>
  
  <p>How to solve the issue and how can i get to install mongo in a correct way all the time 
  steps performed are :</p>
  
  <p>1)apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10</p>
  
  <p>2)echo "deb <a href="http://repo.mongodb.org/apt/ubuntu" rel="nofollow">http://repo.mongodb.org/apt/ubuntu</a> trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list</p>
  
  <p>3)apt-get update</p>
  
  <p>4)apt-get --force-yes -y install mongodb-org </p>
  
  <p>5)echo "mongodb-org hold" | sudo dpkg --set-selections</p>
  
  <p>6)echo "mongodb-org-server hold" | sudo dpkg --set-selections</p>
  
  <p>7)echo "mongodb-org-shell hold" | sudo dpkg --set-selections</p>
  
  <p>8)echo "mongodb-org-mongos hold" | sudo dpkg --set-selections</p>
  
  <p>9)echo "mongodb-org-tools hold" | sudo dpkg --set-selections</p>
  
  <p>any help ??? 
  please :(</p>