Score:1

Failure when trying to run MongoDB on Raspberry Pi 3 B & Ubuntu Server 23.04

ua flag

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.

natiiix avatar
cn flag
Not sure if this information will be of any help to you, but in my case, the version 4.4.22 just doesn't work. I need to use the older version 4.4.1 to get the daemon to start. This may be a different issue, though, as I'm on the latest Raspberry Pi OS rather than Ubuntu, and my error looks slightly different.
Score:0
ua flag

Thanks to @natiiix 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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.