如何在rspberry pi 4上安装mongoDB?

发布于 2025-02-08 16:35:02 字数 2634 浏览 2 评论 0 原文

我正在尝试在Raspberry Pi 4 Model B运行Debian 11.3上安装MongoDB。

首先,我尝试通过运行命令 sudo apt-get安装mongodb 来使用APT-GET安装它,但是结果有以下错误: e:package'mongodb'没有安装候选。 在阅读了MongoDB文档后,我发现这是一个已知问题,这是因为Debian提供的MobogDB软件包无法由Monbodb Inc.维护。

我尝试的第二种方法是来自MongoDB Docs https://www.mongodb.com/docs/manual/manual/tutorial/tutorial/install-mongodb-ongon-debian/-debian/ 这些是来自教程的步骤:

  1. 使用命令 wget -qo -qo -https://www.mongodb.org/static/static/pgp/server-5.0.asc | sudo apt-key add-
  2. 使用命令 echo将mongodb存储库添加到apt racuces porices porice coruce coruce coruce coruce coruce coruce coruce poecho“ deb http://repo.mongodb.org/apt/debian buster/debian buster/debian buster/mongodb-org-org/5.0 main” | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
  3. 运行命令 sudo apt-get update 最后:
    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'
  1. 最后 - 使用 sudo apt -get install -y mongodb -org 安装mongoDB。

完成所有这些步骤后,我遇到了错误:无法找到软件包mongodb-org

我已经看到这个问题以前已经在这里提出,但我在那里没有找到解决方案。 mongodb 4.4/raspberry pi 4

我想获得任何助手或转介人可以帮助我解决这个问题。

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:

  1. 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 -
  2. 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
  3. 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'
  1. 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

命比纸薄 2025-02-15 16:35:02

我目前有一个Raspberry Pi 4运行Ubuntu-22.04.2,我设法与MongoDB进行了适当的安装。

系统更新:

sudo apt-get update
sudo apt-get upgrade

需要安装libss1.1之前安装mongoDB:

sudo wget http://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo apt-get update

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
sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

检查已安装版本:

mongod --version

启动Mongod:

sudo systemctl restart mongod
sudo systemctl status mongod

如果启动良好

sudo apt-mark hold mongodb-org*

安装

I currently have a Raspberry pi 4 running Ubuntu-22.04.2 and I managed to get a proper installation with mongodb.

System update :

sudo apt-get update
sudo apt-get upgrade

Required installation of libss1.1 before installing mongodb :

sudo wget http://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.18_arm64.deb
sudo apt-get update

Installing 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
sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

Checking the installed version :

mongod --version

Launch of mongod :

sudo systemctl restart mongod
sudo systemctl status mongod

If it is well launched you can block the version of mongodb in 4.4.8 :

sudo apt-mark hold mongodb-org*

End

娇纵 2025-02-15 16:35:02

首先,您需要在Raspberry Pi 4上安装Docker引擎。
以下命令:

sudo apt update
sudo apt upgrade   
sudo reboot
curl -fsSL https://get.docker.com -o get-docker.sh
sudo bash get-docker.sh
sudo usermod -aG docker $(whoami)
sudo reboot
docker version

创建MongoDB容器PLZ给我您的O/S版本名称在您的PI 4上运行,然后我更新此答案...
无论如何,您可以运行此命令:

docker run -d -p 27017:27017 -v ~/data:/data/db --name mongo mongo:bionic

尝试此命令64:

docker run -d -p 27017:27017 -v ~/data:/data/db --name mongo arm64v8/mongo

PLZ检查此链接:

At the first, you need to install Docker engine on Raspberry Pi 4.
Following commands:

sudo apt update
sudo apt upgrade   
sudo reboot
curl -fsSL https://get.docker.com -o get-docker.sh
sudo bash get-docker.sh
sudo usermod -aG docker $(whoami)
sudo reboot
docker version

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:

docker run -d -p 27017:27017 -v ~/data:/data/db --name mongo mongo:bionic

try this command for arm64:

docker run -d -p 27017:27017 -v ~/data:/data/db --name mongo arm64v8/mongo

plz check this link:
https://www.mongodb.com/docs/manual/administration/production-notes/?&_ga=2.245956420.1199726907.1655734879-88534791.1655618178#arm64

荒芜了季节 2025-02-15 16:35:02

您可以在github上找到交叉兼容说明和非官方的杂种binaries 在这里

You can find cross-compilation instructions and unofficial MongoDB binaries on Github here.

月朦胧 2025-02-15 16:35:02

我在Raspberry Pi OS 64位上安装了MongoDB(Raspberry Pi 4型B),该教程:,它对我有用。

如果您有原始的SD卡,则可能有预装的32位Raspberry Pi OS。但是MongoDB没有32位用于ARM架构的软件包,因此您需要安装64位操作系统。我使用了“ Raspberry pi os(64-bit)”( https:///wwwww.raspberrypi。应该基于Debian 11。但是MongoDB没有ARM 64体系结构的Debian Packeges,所以我

在终端中使用了Ubuntu软件包...

# update packages
$ sudo apt update && sudo apt upgrade -y

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

# add MongoDB repository
$ 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

# update source list
$ sudo apt update

# install MongoDB
$ sudo apt install mongodb-org

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:

# update packages
$ sudo apt update && sudo apt upgrade -y

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

# add MongoDB repository
$ 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

# update source list
$ sudo apt update

# install MongoDB
$ sudo apt install mongodb-org
星星的轨迹 2025-02-15 16:35:02

这些都不作用。您需要降级openssl libssl。上面的链接不起作用。这是您要做的:

sudo apt-get update
sudo apt-get upgrade

sudo wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb
sudo apt-get update

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
sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

sudo apt-mark hold mongodb-org*

sudo systemctl restart mongod
sudo systemctl enable mongod
sudo systemctl status mongod

它在raspberrypi 4

None of these works. You need to downgrade your openssl libssl. And the link above dont work. Here is what you have to do:

sudo apt-get update
sudo apt-get upgrade

sudo wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb
sudo apt-get update

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
sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8

sudo apt-mark hold mongodb-org*

sudo systemctl restart mongod
sudo systemctl enable mongod
sudo systemctl status mongod

It works on RaspberryPi 4.

MongoDB running on RaspberryPi 4, with Ubuntu 24.04 LTS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文