Unable to start mongodb-org 5 on ubuntu server in virtualbox after installation - Core dump

I followed the instructions from the official documentation, but when checking the status of the process it gives me the following error:

imperium@imperium:~$ sudo systemctl status mongod.service
● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
     Active: failed (Result: core-dump) since Wed 2021-11-03 18:58:22 UTC; 16min ago
       Docs: https://docs.mongodb.org/manual
    Process: 2405 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL)
   Main PID: 2405 (code=dumped, signal=ILL)

nov 03 18:58:22 imperium systemd[1]: Started MongoDB Database Server.
nov 03 18:58:22 imperium systemd[1]: mongod.service: Main process exited, code=dumped, status=4/ILL
nov 03 18:58:22 imperium systemd[1]: mongod.service: Failed with result 'core-dump'.
imperium@imperium:~$

It is a clean install of ubuntu server. How can I fix this?

What i tried

sudo chown -R mongodb:mongodg /var/log/mongodb
sudo chown -R mongodb:mongodg /var/lib/mongodb
sudo chmod -R 755 /var/lib/mongodb
sudo chmod -R 755 /var/log/mongodb

sudo systemctl restart mongod.service

Same result.


sudo mongod --repair --dbpath /var/lib/mongod
> Illegal instruction

imperium@imperium:~$ dmesg | grep mong
[   31.638118] traps: mongod[627] trap invalid opcode ip:565454367a9a sp:7ffc8668ba80 error:0 in mongod[565450400000+5090000]

I found this answer:

MongoDB 5.0 requires a Sandy Bridge or newer CPU. Get a newer processor or use an older version of MongoDB. https://jira.mongodb.org/browse/SERVER-54407

Restored my VM to a snapshot prior to a Mongo 5 installation and install mongodb 4.4 and it now works.