title: Couldn't open file /packages/repodata/repomd.xml
body: <p>I am using Redhat Linux server and trying to install the MongoDB on it.</p>
  
  <p>I am following steps given in the link: <a href="https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/" rel="nofollow noreferrer">https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/</a></p>
  
  <p><strong>Step 1</strong>: Create a /etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly, using yum.</p>
  
  <pre><code>sudo nano /etc/yum.repos.d/mongodb-org-4.0.repo
  </code></pre>
  
  <p><strong>Step 2</strong>: Copy and paste below code in the newly created file.</p>
  
  <pre><code>[mongodb-org-4.0]
  name=MongoDB Repository
  baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
  gpgcheck=1
  enabled=1
  gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
  </code></pre>
  
  <p><strong>Step 3</strong>: To install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:</p>
  
  <pre><code>sudo yum install -y mongodb-org
  </code></pre>
  
  <p>After all this I am getting an error given below:</p>
  
  <pre><code>Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
  file:///packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /packages/repodata/repomd.xml"
  Trying other mirror.`
  
  
  One of the configured repositories failed (local),
  and yum doesn't have enough cached data to continue. At this point the only 
  safe thing yum can do is fail. There are a few ways to work "fix" this:`
  
   1. Contact the upstream for the repository and get them to fix the problem.
  
   2. Reconfigure the baseurl/etc. for the repository, to point to a working
      upstream. This is most often useful if you are using a newer
      distribution release than is supported by the repository (and the
      packages for the previous distribution release still work).
  
   3. Run the command with the repository temporarily disabled
          yum --disablerepo=localrepo ...
  
   4. Disable the repository permanently, so yum won't use it by default. Yum
      will then just ignore the repository until you permanently enable it
      again or use --enablerepo for temporary usage:
  
          yum-config-manager --disable localrepo
      or
          subscription-manager repos --disable=localrepo
  
   5. Configure the failing repository to be skipped, if it is unavailable.
      Note that yum will try to contact the repo. when it runs most commands,
      so will have to try and fail each time (and thus. yum will be be much
      slower). If it is a very temporary problem though, this is often a nice
      compromise:
  
          yum-config-manager --save --setopt=localrepo.skip_if_unavailable=true
  
  failure: repodata/repomd.xml from localrepo: [Errno 256] No more mirrors to try.
  file:///packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /packages/repodata/repomd.xml"
  </code></pre>
  
  <p>Server OS</p>
  
  <pre><code>NAME="Red Hat Enterprise Linux Server"
  VERSION="7.3 (Maipo)"
  ID="rhel"
  ID_LIKE="fedora"
  VERSION_ID="7.3"
  PRETTY_NAME="Red Hat Enterprise Linux"
  ANSI_COLOR="0;31"
  CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:server"
  HOME_URL="https://www.redhat.com/"
  BUG_REPORT_URL="https://bugzilla.redhat.com/"
  REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
  REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
  REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
  REDHAT_SUPPORT_PRODUCT_VERSION="7.3"
  </code></pre>
  
  <p>I already followed steps below but these are not working in my case:</p>
  
  <pre><code>sudo rm -rf /etc/yum.repos.d/mongodb-org-4.0.repo
  
  sudo yum clean all
  </code></pre>
  
  <p>How could i resolve this error? </p>