我无法在我的 Ubuntu 系统中安装 MongoDB,并且在安装时遇到此错误



打开mongodb.org(4.2.6(…

Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.2.6_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.2.6_amd64.deb
/var/cache/apt/archives/mongodb-org-tools_4.2.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

首先,我建议您停止服务器上运行的一切。例如Nginx或Apache或node.js进程。。。

尝试升级你的Ubuntu实例。试试这些命令。

sudo apt update
sudo apt install -y mongodb
sudo systemctl enable mongodb
sudo systemctl enable mongodb.service
sudo systemctl start mongodb

最新更新