简体   繁体   English

为什么我不能用 Homebrew 更新到最新的 MongoDB?

[英]Why can't I update to the latest MongoDB with Homebrew?

I have version 2.0.2 of mongo installed on my mac, which I installed using Homebrew.我的 mac 上安装了 2.0.2 版的 mongo,我使用 Homebrew 安装了它。 The course I'm taking is using the 'aggregate' function, which is only available in version 2.2 of Mongo.我正在学习的课程是使用“聚合”功能,该功能仅在 Mongo 2.2 版中可用。 I tried to do我试着做

 brew upgrade mongodb

and I get我得到

Error: mongodb already upgraded

Is there a way to install the latest version of Mongo with Homebrew?有没有办法用 Homebrew 安装最新版本的 Mongo?

If the version of mongodb in your brew receipe is the same of the version installed, you get the stated error.如果 brew receipe 中的 mongodb 版本与安装的版本相同,则会出现所述错误。

Typically when you see a latest stable version released and you wish to bump up your mongodb version to it, you'd first have to update your brew receipe and then do your upgrade as you did.通常,当您看到发布的最新稳定版本并希望将 mongodb 版本升级到它时,您首先必须更新您的 brew receipe,然后按照您的方式进行升级。

That means you'd first do这意味着你首先要做

brew update

and then接着

brew upgrade mongodb

This command should update your homebrew formulae to their latest version:此命令应将您的自制程序公式更新为最新版本:

brew update

And then:接着:

brew upgrade mongodb

To install the latest version of mongodb.安装最新版本的mongodb。

for MacOS Catalina适用于 MacOS Catalina

First, you install Homebrew.首先,您安装 Homebrew。 If you're curious about what Homebrew is, read this article.如果您对 Homebrew 是什么感到好奇,请阅读这篇文章。

# Installs Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Second, find the MongoDB tap.其次,找到 MongoDB 水龙头。

brew tap mongodb/brew

Third, install MongoDB.第三,安装MongoDB。

brew install mongodb-community

You should be able to run: brew upgrade mongodb您应该能够运行: brew upgrade mongodb

now and it'll update prior to upgrading your version of mongodb.现在,它会在升级您的 mongodb 版本之前更新。

您只需要运行以下命令即可将 MongoDB 更新到最新版本:

$ brew update && brew upgrade mongodb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM