0

I am trying to install & run MongoDB on my Raspberry Pi 3 B running Ubuntu.

After installing and trying to start it, I get this status:

srv_user@raspserver:~$ sudo systemctl start mongod
srv_user@raspserver:~$ sudo systemctl status mongod
× mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; preset: enabled)
     Active: failed (Result: core-dump) since Sat 2023-07-08 01:23:51 CEST; 3s ago
   Duration: 1.448s
       Docs: https://docs.mongodb.org/manual
    Process: 36515 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL)
   Main PID: 36515 (code=dumped, signal=ILL)
        CPU: 120ms
srv_user@raspserver:~$ mongo
Illegal instruction (core dumped)

Here are the OS information:

srv_user@raspserver:~$ uname -a
Linux raspserver 6.2.0-1007-raspi #9-Ubuntu SMP PREEMPT Wed Jun 21 18:54:19 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

srv_user@raspserver:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.04
Release:        23.04
Codename:       lunar

And here are the commands I've used to install MongoDB:

#####Removing old files#####
sudo rm /etc/apt/sources.list.d/mongodb*.list

sudo service mongod stop

sudo apt-get purge mongodb-org*

sudo apt autoremove

sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
############################

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt-get update --allow-insecure-repositories

sudo apt-get install -y mongodb-org

sudo systemctl start mongod

sudo systemctl status mongod

Leads to this output:

srv_user@raspserver:~$ sudo rm /etc/apt/sources.list.d/mongodb*.list
rm: cannot remove '/etc/apt/sources.list.d/mongodb*.list': No such file or directory
srv_user@raspserver:~$ sudo service mongod stop
srv_user@raspserver:~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'mongodb-org-database-tools-extra' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools-unstable' for glob 'mongodb-org*'
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-tools-unstable' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
Package 'mongodb-org-database-tools-extra' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  mongodb-database-tools mongodb-mongosh
Use 'sudo apt autoremove' to remove them.
(Reading database ... 140652 files and directories currently installed.)
Removing mongodb-org-mongos (4.4.22) ...
Removing mongodb-org-server (4.4.22) ...
Removing mongodb-org-shell (4.4.22) ...
Processing triggers for man-db (2.11.2-1) ...
(Reading database ... 140629 files and directories currently installed.)
Purging configuration files for mongodb-org-server (4.4.22) ...
Purging configuration files for mongodb-org (4.4.22) ...
srv_user@raspserver:~$ sudo apt autoremove
[sudo] password for srv_user:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  mongodb-database-tools mongodb-mongosh
0 upgraded, 0 newly installed, 2 to remove and 2 not upgraded.
After this operation, 180 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 140628 files and directories currently installed.)
Removing mongodb-database-tools (100.7.3) ...
Removing mongodb-mongosh (1.10.1) ...
Processing triggers for man-db (2.11.2-1) ...
srv_user@raspserver:~$ sudo rm -r /var/log/mongodb
srv_user@raspserver:~$ sudo rm -r /var/lib/mongodb
srv_user@raspserver:~$ wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
srv_user@raspserver:~$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse
srv_user@raspserver:~$ sudo apt-get update --allow-insecure-repositories
Hit:1 http://ports.ubuntu.com/ubuntu-ports lunar InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports lunar-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports lunar-backports InRelease
Ign:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports lunar-security InRelease
Get:6 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release [3094 B]
Get:7 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 Release.gpg [866 B]
Get:8 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 Packages [49.5 kB]
Get:9 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 Packages [40.5 kB]
Fetched 93.9 kB in 6s (16.8 kB/s)
Reading package lists... Done
W: https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/4.4/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
srv_user@raspserver:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  mongodb-database-tools mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server mongodb-org-shell
  mongodb-org-tools
The following NEW packages will be installed:
  mongodb-database-tools mongodb-org mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server
  mongodb-org-shell mongodb-org-tools
0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded.
Need to get 95.4 MB/95.4 MB of archives.
After this operation, 194 MB of additional disk space will be used.
Get:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-database-tools arm64 100.7.3 [49.1 MB]
Get:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-org-shell arm64 4.4.22 [12.3 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-org-server arm64 4.4.22 [18.9 MB]
Get:4 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse arm64 mongodb-org-mongos arm64 4.4.22 [15.1 MB]
Fetched 95.4 MB in 13s (7393 kB/s)
Selecting previously unselected package mongodb-database-tools.
(Reading database ... 140607 files and directories currently installed.)
Preparing to unpack .../0-mongodb-database-tools_100.7.3_arm64.deb ...
Unpacking mongodb-database-tools (100.7.3) ...
Selecting previously unselected package mongodb-org-shell.
Preparing to unpack .../1-mongodb-org-shell_4.4.22_arm64.deb ...
Unpacking mongodb-org-shell (4.4.22) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../2-mongodb-org-server_4.4.22_arm64.deb ...
Unpacking mongodb-org-server (4.4.22) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../3-mongodb-org-mongos_4.4.22_arm64.deb ...
Unpacking mongodb-org-mongos (4.4.22) ...
Preparing to unpack .../4-mongodb-org-database-tools-extra_4.4.22_arm64.deb ...
Unpacking mongodb-org-database-tools-extra (4.4.22) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../5-mongodb-org-tools_4.4.22_arm64.deb ...
Unpacking mongodb-org-tools (4.4.22) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../6-mongodb-org_4.4.22_arm64.deb ...
Unpacking mongodb-org (4.4.22) ...
Setting up mongodb-org-server (4.4.22) ...
Setting up mongodb-org-shell (4.4.22) ...
Setting up mongodb-database-tools (100.7.3) ...
Setting up mongodb-org-mongos (4.4.22) ...
Setting up mongodb-org-database-tools-extra (4.4.22) ...
Setting up mongodb-org-tools (4.4.22) ...
Setting up mongodb-org (4.4.22) ...
Processing triggers for man-db (2.11.2-1) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

I am currently guessing it's the Ubuntu release which might be the problem, but before doing a clean install of an older version I wanted to ask and see if maybe someone has had a similar experience.

2
  • Is your 3B booted as a 64-bit system? If not then forget running MongoDB.
    – Dougie
    Jul 8, 2023 at 7:32
  • @Dougie Yes, 64-bit Ubuntu Server 23.04. I used the Raspberry Pi Image tool.
    – cryseascr
    Jul 8, 2023 at 7:42

2 Answers 2

0

Thanks to @natiiix on the askubuntu forum I have managed to successfully install and start mongodb. It has something to do with the specific version I had used before: 4.4.22

Although I had also tried other versions such as 3.2, 2.4 and others, it did not work at all. Only the version 4.4.1 works.

These are the commands I used:

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
    
echo "deb [ arch=arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt-get update --allow-insecure-repositories

sudo apt-get install -y mongodb-org=4.4.1  mongodb-org-server=4.4.1  mongodb-org-shell=4.4.1 mongodb-org-mongos=4.4.1 mongodb-org-tools=4.4.1 

echo "mongodb-org hold" | sudo dpkg --set-selections &&
echo "mongodb-org-server hold" | sudo dpkg --set-selections &&
echo "mongodb-org-shell hold" | sudo dpkg --set-selections &&
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections &&
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
0

If you would like to run a modern version of MongoDB on a Pi, I have compiled from source and published the binaries on Github. I have not tried running them on a Pi 3, but you can give it a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.