如何在 Ubuntu 上安装 mongodb-clients 最新版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45995152/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 20:58:18  来源:igfitidea点击:

How to install mongodb-clients latest version on Ubuntu?

mongodbubuntu

提问by Alexander Zeitler

How do I install latest version of mongodb-clientson Ubuntu using apt-get?

如何mongodb-clients使用 Ubuntu 在 Ubuntu 上安装最新版本apt-get

apt-get install mongodb-clientsonly installs version 2.4.9.

apt-get install mongodb-clients只安装版本2.4.9

回答by Alexander Zeitler

On Ubuntu 16.04 to get the 4.2 mongo client

在 Ubuntu 16.04 上获取 4.2 mongo 客户端

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

sudo apt-get update
sudo apt-get install mongodb-org-shell

回答by Vineet Jain

Use official MongoDB Documents they already mentioned how to install a version of your choice. Steps for installation for Ubuntu 12.04 and 14.04

使用他们已经提到的官方 MongoDB 文档如何安装您选择的版本。Ubuntu 12.04 和 14.04 的安装步骤

For Ubuntu 16.04 use this

对于 Ubuntu 16.04 使用这个

NOTE:-Before that beware that you don't have any existing repository file for MongoDB. You can check using sudo apt-get update.While updating it will show if you have any. If you have then delete it using sudo rm /etc/apt/sources.list.d/mongodb*.listand then install MongoDB

注意:-在此之前请注意,您没有任何现有的 MongoDB 存储库文件。您可以使用sudo apt-get update.While进行检查,更新时会显示是否有。如果您有然后使用删除它sudo rm /etc/apt/sources.list.d/mongodb*.list然后安装MongoDB

回答by user3761116

For mongodb 3.2, below packages are supported. In order to use mongo shell, you need to install mongo-org-shell. Choose the right package according to your requreiements.

install mongodb on ubuntu

对于 mongodb 3.2,支持以下包。为了使用 mongo shell,你需要安装 mongo-org-shell。根据您的要求选择合适的包装。

在 ubuntu 上安装 mongodb

enter image description here

在此处输入图片说明

回答by 030

One could install a mongodb shell on Ubuntu 18.04 by following these instructionsor by using an Ansible like Ansible Galaxy.

可以按照这些说明或使用 Ansible 之类的Ansible 银河.

At the time of writing, this ansible role installed version 4.2.5 of the mongo shell:

在撰写本文时,这个 ansible 角色安装了 mongo shell 的 4.2.5 版本:

user@some-host:~/some-dir$ mongo --version
MongoDB shell version v4.2.5
git version: x
OpenSSL version: OpenSSL y
allocator: z
modules: none
build environment:
    distmod: ubuntu1804
    distarch: x86_64
    target_arch: x86_64

回答by Ray

20.04 focal is not setup yet, but you can use the instructions for bionic (18.04) successfully. I did! Ray.

20.04 焦点尚未设置,但您可以成功使用仿生 (18.04) 的说明。我做到了!射线。