E: 无法定位包 mongodb-org [英] E: Unable to locate package mongodb-org
问题描述
我正在尝试下载 mongodb,我正在按照此 链接.
I am trying to download mongodb and I am following the steps on this link.
但是当我走到这一步时:
But when I get to the step:
sudo apt-get install -y mongodb-org
我收到以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org //This is the error
为什么会发生这种情况,是否有解决办法?
Why is this occurring and is there a work around?
推荐答案
我遇到了同样的问题,但通过更改包文件部分命令来修复它.我遵循的整个步骤是:
I faced same issue but fix it by the changing the package file section command. The whole step that i followed was:
首先尝试使用这个命令:sudo apt-get install -y mongodb
At first try with this command: sudo apt-get install -y mongodb
这是Ubuntu提供的非官方mongodb包,非MongoDB维护,与MongoDB官方支持的包冲突.
This is the unofficial mongodb package provided by Ubuntu and it is not maintained by MongoDB and conflict with MongoDB’s offically supported packages.
如果上述命令不起作用,那么您可以通过以下程序之一解决问题:
If the above command not working then you can fix the issue by one of the bellow procedure:
#Step 1: Import the MongoDB public key
#In Ubuntu 18.*+, you may get invalid signatures. --recv value may need to be updated to EA312927.
#See here for more details on the invalid signature issue: [https://stackoverflow.com/questions/34733340/mongodb-gpg-invalid-signatures][1]
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
#Step 2: Generate a file with the MongoDB repository url
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
#Step 3: Refresh the local database with the packages
sudo apt-get update
#Step 4: Install the last stable MongoDB version and all the necessary packages on our system
sudo apt-get install mongodb-org
#Or
# The unofficial mongodb package provided by Ubuntu is not maintained by MongoDB and conflict with MongoDB’s offically supported packages. Use the official MongoDB mongodb-org packages, which are kept up-to-date with the most recent major and minor MongoDB releases.
sudo apt-get install -y mongodb
希望这也适用于您.你可以按照这个MongoDB
Hope this will work for you also. You can follow this MongoDB
更新上面的说明将安装 mongodb 2.6 版本,如果你想安装 Uubuntu 12.04
的最新版本,那么只需替换上面的 step 2
并按照下面的说明进行操作:
Update
The above instruction will install mongodb 2.6 version, if you want to install latest version for Uubuntu 12.04
then just replace above step 2
and follow bellow instruction instead of that:
#Step 2: Generate a file with the MongoDB repository url
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
如果您使用的是 Ubuntu 14.04
然后使用下面的步骤而不是上面的 step 2
If you are using Ubuntu 14.04
then use bellow step instead of above step 2
#Step 2: Generate a file with the MongoDB repository url
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
这篇关于E: 无法定位包 mongodb-org的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!