Update Ubuntu 20.4; fix "release not found" error: https//

I am having an issue when trying to update my packages in Ubuntu 20.4. The error I’m receiving is:

Err:13 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/3.6.3 Release 404 Not Found [IP: 443]

I have already uninstalled MongoDB from my machine, yet I am still receiving this error when I run:

sudo apt-get update
sudo apt autoremove

Can someone please help? Thank you.

The error you are encountering is caused by the fact that the repository you are trying to access does not have the specific version of MongoDB (3.6.3) available for Ubuntu 20.04.

To resolve this issue, you can follow these steps:

  1. Open the terminal.
  2. Edit the /etc/apt/sources.list file using a text editor (e.g., nano or vim).
  3. Locate the line that contains the MongoDB repository URL (https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/3.6.3) and comment it out by adding a # at the beginning of the line.
  4. Save the file and exit the text editor.
  5. Run the following commands to update the package lists and remove any unnecessary packages:
sudo apt-get update
sudo apt-get autoremove

Now, the error should no longer appear when you update your packages.