To update brew and installed packages, you usually should only have to do the following commands (1):
1 brew update # updates brew itselfIf you are lucky that day, it will work without a hitch! If not, here are some tips:
2 brew upgrade # upgrades all brew installed packages to latest versions
0. The doctor is your best friend
Issue the "brew doctor" command. The doc will tell you what's wrong. Heed the doctor's orders and it will go a long way to reduce frustration.
1. Make sure your brew --prefix directory is owned by you
At some point, something will mess with the ownership and permissions on this directory (typically /usr/local) and brew will be unable to write to it. The following command will usually remedy the problem (2):
1 sudo chown -R $(whoami) /usr/localThis command will run as super user and recursively change ownership of that directory and its contents to you, the local user.
2. A hosed brew installation should be reset
Your brew installation may just be completely screwed from the onset. For instance, when you attempt a brew update you may get an error stating (among other things) that "The following untracked working tree files would be overwritten by merge." In this case, reset your brew installation to the master (3):
1 cd $(brew --prefix)
2 git fetch origin
3 git reset --hard origin/master
3. Update your Xcode installation and/or Command Line Tools for Xcode (CLT)
Homebrew depends on stuff Xcode/CLT installs. Other packages Homebrew installs depend on stuff Xcode/CLT installs. Updating it is usually a good idea. If you do this by installing Xcode, you still have to do a few more things:
- Install Xcode from the App Store
- Launch Xcode
- Accept the License Agreement (most important step, otherwise Xcode is a dud)
- Go to Preferences > Downloads
- Install/Update Command Line Tools
I hope these tips save some of you a bit of time and hours of your life back!
Sources / References
1. Homebrew FAQ
2. Homebrew Troubleshooting
3. Reverting to Master Branch
Good Links
Homebrew Troubleshooting
Homebrew and Python
Homebrew Homepage
1 comment:
Before we get into how to use XCode on Windows, we should first define XCode. So XCode is an Integrated Development Environment (IDE), which is essentially a very powerful piece of software used to create Mac apps. If you intend to design programmes for the Mac OS, you should be aware that XCode is an Apple-created toolset that will help you get there. Designing apps for Windows is a far more doable effort because you can accomplish it on any platform. However, if you want to create Apple applications, XCode is essential.
Post a Comment