Please note that we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
brew command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update and can still reproduce the problem?brew doctor, fixed all issues and can still reproduce the problem?brew config and brew doctor and included their output with your issue?I'm trying to run brew cleanup to remove old cached bottles to free up some space.
The old version of mongodb was not removed even though a new version is installed and running.
Command output
...
Removing: /Users/xeoneux/Library/Caches/Homebrew/libgpg-error--1.33.mojave.bottle.tar.gz... (277.1KB)
Warning: Skipping mongodb: most recent version 4.0.3_1 not installed
Removing: /usr/local/Cellar/node/11.6.0... (3,938 files, 46.6MB)
Removing: /Users/xeoneux/Library/Caches/Homebrew/node--11.6.0.mojave.bottle.tar.gz... (12.7MB)
Removing: /Users/xeoneux/Library/Caches/Homebrew/sqlite--3.26.0_1.mojave.bottle.tar.gz... (1.8MB)
Removing: /Users/xeoneux/Library/Caches/Homebrew/sqlite--3.26.0.mojave.bottle.tar.gz... (1.8MB)
==> This operation has freed approximately 63.9MB of disk space.
➜ ~ brew upgrade mongodb
Error: mongodb 4.0.5 already installed
brew should remove old mongodb cache.
brew commands)Installed old mongodb via brew command and it did update but cleanup failed to remove the new version. This has happened with me before with another formula and maybe it's not specific to mongodb.
Thanks, I'm experiencing the same issue.
I'm going to add my logs, hoping that they could be useful
$ brew update
Already up-to-date.
$ brew upgrade
$ brew -v
Homebrew 1.9.2
Homebrew/homebrew-core (git revision fbfc; last commit 2019-01-20)
Homebrew/homebrew-cask (git revision 20ab36; last commit 2019-01-20)
$ brew info mongodb
mongodb: stable 4.0.3 (bottled)
High-performance, schema-free, document-oriented database
https://www.mongodb.com/
/usr/local/Cellar/mongodb/4.0.5 (18 files, 223MB) *
Poured from bottle on 2019-01-12 at 11:55:53
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mongodb.rb
==> Dependencies
Build: go ✘, pkg-config ✔, scons ✘
Required: openssl ✔, python@2 ✔
==> Requirements
Build: xcode ✔
Required: macOS >= 10.8 ✔
==> Caveats
To have launchd start mongodb now and restart at login:
brew services start mongodb
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Analytics
install: 40,296 (30 days), 143,226 (90 days), 609,767 (365 days)
install_on_request: 37,275 (30 days), 131,885 (90 days), 546,268 (365 days)
build_error: 0 (30 days)
$ brew cleanup
Warning: Skipping mongodb: most recent version 4.0.3_1 not installed
$ brew upgrade mongodb
Error: mongodb 4.0.5 already installed
$ brew install mongodb
Error: mongodb 4.0.5 is already installed
To install 4.0.3_1, first run `brew unlink mongodb`
This is because we downgraded mongodb, see https://github.com/Homebrew/homebrew-core/pull/36078.
The last version in homebrew is 4.0.3_1 (4.0.5 should never have existed, it was a mistake).
I would recommend you to uninstall mongodb completely with brew uninstall mongodb, run brew cleanup to get rid of any caches, and then install it properly again.
Ah, got it. Now I remember, this happened once with node formula as well when a new version was released but then removed due to some dependency issue. The same situation took place then as well :smile:
Most helpful comment
This is because we downgraded mongodb, see https://github.com/Homebrew/homebrew-core/pull/36078.
The last version in homebrew is 4.0.3_1 (4.0.5 should never have existed, it was a mistake).
I would recommend you to uninstall mongodb completely with
brew uninstall mongodb, runbrew cleanupto get rid of any caches, and then install it properly again.