I am trying to install mongodb on my Raspberry PI 4 model B running Debian 11.3.
First i tried to install it using apt-get by running the command sudo apt-get install mongodb
but it result with the following error: E: Package ‘mongodb’ has no installation candidate.
After reading mongodb docs i found that it’s a known issue and it’s because the mobogdb package provided by Debian is not maintained by MonboDB Inc.
The second way i tried was from MongoDB docs https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/
Those are the steps from the tutorial:
- Import the MongoDB public GPG Key using the command
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
- Add the MongoDB repository to apt soruces list file using the command
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
- Run the command
sudo apt-get update
and got:
Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
Ign:2 https://repo.mongodb.org/apt/debian focal/mongodb-org/4.4 InRelease
Ign:3 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 InRelease
Get:4 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Hit:5 https://deb.nodesource.com/node_16.x bullseye InRelease
Err:6 https://repo.mongodb.org/apt/debian focal/mongodb-org/4.4 Release
404 Not Found [IP: 13.226.2.64 443]
Hit:7 http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 Release
Reading package lists... Done
N: Ignoring file 'mongodb-org-4.0.lis' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: The repository 'https://repo.mongodb.org/apt/debian focal/mongodb-org/4.4 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 InRelease' doesn't support architecture 'armhf'
- Finally – Install mongodb with
sudo apt-get install -y mongodb-org
.
After complete all these steps i’ve got the error: Unable to locate package mongodb-org.
I have seen that this issue has been raised here before but i have not found a solution there.
MongoDB 4.4 / Raspberry Pi 4
I would like to get any assistent or referrences that could help me solving this issue.
3
Answers
At the first, you need to install Docker engine on Raspberry Pi 4.
Following commands:
To create MongoDB container plz give me your O/S version name running on your Pi 4 and then I update this answer…
anyway you can run this command:
try this command for arm64:
plz check this link:
https://www.mongodb.com/docs/manual/administration/production-notes/?&_ga=2.245956420.1199726907.1655734879-88534791.1655618178#arm64
I installed MongoDB on Raspberry Pi OS 64-bit (Raspberry Pi 4 model B) by this tutorial: https://linuxhint.com/install-mongodb-raspberry-pi/ and it worked for me.
If you have original SD card, there is probably preinstalled 32-bit Raspberry Pi OS. But MongoDB doesn’t have 32bit packages for ARM architecture, so you need to install 64-bit operating system. I used "Raspberry Pi OS (64-bit)" (https://www.raspberrypi.com/software/operating-systems/) which should be based on Debian 11. But MongoDB doesn’t have Debian packeges for ARM 64 architecture, so I used Ubuntu package…
In terminal:
You can find cross-compilation instructions and unofficial MongoDB binaries on Github here.