Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew upgrade <package> does not update to the latest version

I've noticed this happening a few times but this most recent instance is with wp-cli Running brew upgrade wp-cli does not download the latest version.

$ brew upgrade wp-cli
Error: homebrew/php/wp-cli 0.20.1 already installed

$ brew info wp-cli
homebrew/php/wp-cli: stable 0.20.1, HEAD
A set of command-line tools for managing WordPress installations.
http://wp-cli.org/
/usr/local/Cellar/wp-cli/0.20.1 (2635 files, 15M) *
  Built from source
From: https://github.com/Homebrew/homebrew-php/blob/master/Formula/wp-cli.rb

Note the version is 0.20.1. When I check the formula repo, I see,

head "https://github.com/wp-cli/wp-cli.git"

When I check that repo, I see that the version in the master branch is 0.24.0. brew info and wp --version both return 0.20.1. Why isnt Homebrew grabbing the latest version? How do I force it to get the latest?

like image 948
Jeff Avatar asked May 03 '16 22:05

Jeff


People also ask

Does Homebrew automatically update packages?

An easy, convenient way to automatically update Homebrew. This script will run brew update in the background once every 24 hours (by default) until explicitly told to stop, utilising launchd . brew upgrade and brew cleanup can also be handled automatically but are optional flags.

What is the difference between brew update and brew upgrade?

brew update and upgradebrew update updates the above downloaded git repository with the latest code from GitHub. brew upgrade updates the actual packages to match the versions in the updated local git repository.

How do I update all packages on Mac?

If your older Mac doesn't include Software Update, open the App Store app, which is in your Applications folder. Then click the Updates tab in the App Store to check for updates. You can also search for software by name.

How do I install a specific version of a package with brew?

When you try to install a package using brew install <package_name> brew installs a latest version the package based on the time you last installed/updated the homebrew in your machine. To install an older version, sometimes the command brew install <package_name@version> will work.


1 Answers

You'll need to run brew update first to force brew to update its list of formulae.

like image 69
maximede Avatar answered Oct 07 '22 00:10

maximede