Also had the same problem and the above answer did help tremendously, but I found a couple stuff missing. My issue was also of the processor compatibility and required to uninstall the version I had installed and install a earlier version of MongoDB.
Here are the steps I followed, that did it for me
First, Uninstall the MongoDB version you had installed, requires removing the used repo from the sources.list
, otherwise it will just keep installing that one (or latest version), even after uninstalling it. So to remove the repo from the sources.list
follow these steps:
List the contents of sources.list directory using
ls -l /etc/apt/sources.list.d/
Remove the repo(s) using the command
sudo rm /etc/apt/sources.list.d/<repo_name>
Once the repo(s) are removed, uninstall MongoDB. Use these commands:
sudo apt purge "mongodb-org*"
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
After uninstalling MongoDB, you might want to update the package list, so use
sudo apt update
From here onward, you can follow the steps for installing the lower version of MongoDB you want as outlined in the manual. Just make sure you select the version you want.
If it happens that the earlier version you get to also throws the same error, repeat the process, going to an earlier version still.