title: Unable to install mongodb properly on ubuntu 18.04 LTS
body: <p>I am trying to install mongodb on my Ubuntu 18.04 LTS, but it has the following error saying</p>
  
  <blockquote>
    <p>You might want to run 'apt --fix-broken install' to correct these. The
    following packages have unmet dependencies:  mongodb-org : Depends:
    mongodb-org-server but it is not going to be installed
                   Depends: mongodb-org-mongos but it is not going to be installed
                   Depends: mongodb-org-tools but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with
    no packages (or specify a solution).
    umar@umar-Lenovo-ideapad-320-15ISK:~/Desktop/portfolio/async-demo$
    sudo apt-get install -y mongodb</p>
  </blockquote>
  
  <p>I beleieve the reason behind this is already mentioned on their website, clearly saying</p>
  
  <blockquote>
    <p>PLATFORM SUPPORT</p>
    
    <p>MongoDB only provides packages for 64-bit LTS (long-term support)
    Ubuntu releases; for example, 14.04 LTS (trusty) and 16.04 LTS
    (xenial). See Supported Platforms for more information.</p>
    
    <p>These packages may work with other Ubuntu releases; however, they are
    not supported.</p>
  </blockquote>
  
  <p>So how can I install mongodb on my latest Ubuntu 18.04 LTS?
  For sake of clarity, I am listing the things I did to correct the errors:
  I followed their official website to install mongodb</p>
  
  <pre><code>1. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
  2. echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
  3. sudo apt-get update
  4. sudo apt-get install -y mongodb-org
  </code></pre>
  
  <blockquote>
    <p>Now here I got errors saying: You might want to run 'apt --fix-broken
    install' to correct these. The following packages have unmet
    dependencies:</p>
  </blockquote>
  
  <p>I tried,</p>
  
  <pre><code>apt --fix-broken install
  </code></pre>
  
  <p>It did not work, somewhere I got clue to run</p>
  
  <pre><code>sudo apt -f install
  </code></pre>
  
  <p>It also returned error. </p>
  
  <blockquote>
    <p>Errors were encountered while processing: 
    /var/cache/apt/archives/mongodb-org-server_4.0.0_amd64.deb 
    /var/cache/apt/archives/mongodb-org-mongos_4.0.0_amd64.deb 
    /var/cache/apt/archives/mongodb-org-tools_4.0.0_amd64.deb E:
    Sub-process /usr/bin/dpkg returned an error code (1)</p>
  </blockquote>
  
  <p>I believe the main problem is compatability with version. So basically I have Ubuntu 18.04, how I install mongodb on this version, so that I can work without any trouble.</p>