gpt4 book ai didi

node.js - 无法在 Ubuntu 18.04 Bionic 上安装/删除 mongodb-org - "mongodb-org-tools : Depends: mongodb-database-tools but it is not installed"

转载 作者:行者123 更新时间:2023-12-04 19:06:16 25 4
gpt4 key购买 nike

我尝试按照 the mongodb.com instructions 的说明安装 mongodb .
当我运行时:sudo apt-get install -y mongodb-org ,我得到以下信息:

The following packages have unmet dependencies.
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
建议运行 apt --fix-broken install .所以我用 sudo 运行它.我得到以下信息:
The following packages were automatically installed and are no longer required:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5 mongo-tools
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-database-tools
然后失败,并出现以下错误报告:
Unpacking mongodb-database-tools (100.5.0) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.5.0_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-database-tools_100.5.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我的阅读: trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1向我暗示 mongo-tools 中有一些东西那是固执地不让自己被移除。所以我尝试运行 sudo apt autoremove删除 mongo-tools .不幸的是,我得到以下信息:
The following packages have unmet dependencies.
mongodb-org-tools : Depends: mongodb-database-tools but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
所以我试试 apt --fix-broken install再次,按照建议,但没有任何成功。我需要想办法摆脱那个该死的 mongo-tools - 但如何?我尝试按照上面链接的同一页面上的“卸载 MongoDB 社区版”说明进行操作。
当我输入 sudo apt-get purge mongodb-org* ,这构成了消息的一部分:
The following packages were automatically installed and are no longer required:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5 mongo-tools mongodb-mongosh
Use 'sudo apt autoremove' to remove them.
所以现在我有 mongo-tools还有这个新的 mongodb-mongosh ?我试图再次安装,但我遇到了同样的问题。解决方法是什么?

最佳答案

1.停止mongod通过发出以下命令进行处理:-

    sudo service mongod stop
2.删除您之前安装的任何 MongoDB 包:-
    sudo apt-get purge mongodb-org*
3.删除MongoDB数据库和日志文件:-
    sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
4.然后重新安装mangodb 4.4.8
5.导入包管理系统使用的公钥:-
    wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
6.以下说明适用于 Ubuntu 18.04 (Bionic):-
    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
7.更新Apt
    sudo apt-get update
8.安装mongodb
    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
9.使用 mongod --version检查其是否已成功安装。
10.如果您在使用 mongod时遇到任何错误
    sudo mkdir /data
cd /data
sudo mkdir db
sudo pkill -f mongod
11.然后使用 sudo mongod命令启动服务器。
12.使用 mongo使用 mongodb shell

关于node.js - 无法在 Ubuntu 18.04 Bionic 上安装/删除 mongodb-org - "mongodb-org-tools : Depends: mongodb-database-tools but it is not installed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68862012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com