为什么我不能用 Homebrew 更新到最新的 MongoDB?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13187877/
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
Why can't I update to the latest MongoDB with Homebrew?
提问by BrainLikeADullPencil
I have version 2.0.2 of mongo installed on my mac, which I installed using Homebrew. The course I'm taking is using the 'aggregate' function, which is only available in version 2.2 of Mongo. I tried to do
我的 mac 上安装了 2.0.2 版的 mongo,我使用 Homebrew 安装了它。我正在学习的课程是使用“聚合”功能,该功能仅在 Mongo 2.2 版中可用。我试着做
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?
回答by karthiks
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
回答by edouardbriere
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。
回答by kheengz
for MacOS Catalina
适用于 MacOS Catalina
First, you install Homebrew. If you're curious about what Homebrew is, read this article.
首先,您安装 Homebrew。如果您对 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
回答by Long_Live_King
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 版本之前更新。
回答by Soroush Chehresa
You just need to run the following command to update MongoDB to their latest version:
您只需要运行以下命令即可将 MongoDB 更新到最新版本:
$ brew update && brew upgrade mongodb