I followed the official MongoDB documentation to install the Community Edition but it kept crashing with a core dump:
× mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; preset: enabled)
Active: failed (Result: core-dump) since Fri 2024-11-15 17:43:33 GMT; 3min 54s ago
Duration: 219ms
Docs: https://docs.mongodb.org/manual
Process: 417164 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL)
Main PID: 417164 (code=dumped, signal=ILL)
CPU: 12ms
Nov 15 17:43:33 homepc systemd[1]: Started mongod.service - MongoDB Database Server.
Nov 15 17:43:33 homepc systemd[1]: mongod.service: Main process exited, code=dumped, status=4/ILL
Nov 15 17:43:33 homepc systemd[1]: mongod.service: Failed with result 'core-dump'.
I ran it by hand to see if I'd get a different answer, but no.
mrn@localhost::/tmp$ sudo /usr/bin/mongod --config /etc/mongod.conf
Illegal instruction
It turns out that MongoDB greater than version 5.0 uses the AVX CPU instruction set and it is this that is causing the illegal instruction message.
You can test if your CPU supports AVX with this simple command:
if [ "`cat /proc/cpuinfo | grep avx`" = "" ]; then echo No; else echo Yes; fi