For some time I've had a
/usr/local/Library/Contributions/
directory on my system and have been loading at least a brew_bash_completion.sh from it with
source $(brew --repository)/Library/Contributions/brew_bash_completion.sh
in my .bash_profile.
But suddenly I have no /usr/local/Library/Contributions/ directory at all!
Has this directory been moved or deprecated by Homebrew? What is the current best way to get support for brew bash completion?
The Homebrew completion script is at /usr/local/etc/bash_completion.d/brew (or, more generally, $(brew --prefix)/etc/bash_completion.d/brew). This change was made on April 3rd in commit edf000e when some parts of Homebrew were re-organized.
Related
I installed an app, which triggered an update of Homebrew and apparently also of some apps. Now I am unable to get some apps running, for example MySQL.
Some apps complain about not finding libicuuc.70.dylib after icu4c71.1 has been apparently installed by the update cycle.
I would like to revert the whole Homebrew installation to the point before the update was triggered to get my apps running again and to find out what went wrong. I can rely on TimeMachine.
Which directories do I have to replace through a backup?
I have the following directories in /usr/local :
/usr/local/bin
/usr/local/Caskroom
/usr/local/Cellar
/usr/local/etc
/usr/local/Frameworks
/usr/local/Homebrew
/usr/local/include
/usr/local/lib
/usr/local/opt
/usr/local/remotedesktop
/usr/local/sbin
/usr/local/share
/usr/local/var
At the end I resorted to restoring the complete /usr/local directory from a Timemachine backup and got all homebrew installed applications running again.
I did the following:
delete the content in /usr/local.
enter Time Machine and go to a specific time in the past, where the system was still running
selected all the files and directories and restored them
The var directory gets generated automatically by the system, once it is deleted, but it there where no conflicts. At first I tried to restore with out deleting the content of /usr/local before restoring it, but I got an error and the restore did not complete. After deleting it before the restore everything went through.
I still do not know what broke my system and would like to know more about Homebrew. In the time I am using homebrew it changed a lot the way it works and consequently my experience and the unexpected results I get sometimes.
I uninstalled Homebrew on my MAC, but got this message at the end:
The following possible Homebrew files were not deleted:
/opt/homebrew/SECURITY.md
/opt/homebrew/etc/
/opt/homebrew/share/
/opt/homebrew/var/
You may wish to remove them yourself.
I was able to remove the first item, but when I tried to remove the remaining three with "rmdir," I kept getting the "_____ is a directory" output. What am I missing?
Thanks.
Apparently, rmdir only works if the directory is empty, looking at this linux man page. You could try to remove them using rm -rf <path to folder> instead.
Maybe not an answer, but seems these folder are left on purpose. They are not part of the Homebrew package manager itself. But config, file, cache, etc content generated by brew-installed package.
Especially, make sure you have a backup of these settings before you remove it with rm -rf.
I am running out of space on my laptop, and I was wondering if it would be possible to change the default directory of installing casks on an external hard drive so that I can use the internal hard drive just for the OS and important files.
I guess you can overwrite the environment variable HOMEBREW_CASK_OPTS or you can use the --appdir=/my/path option. You can get more information with the command man brew-cask and there is a nice markdown documentation in the cask repository. Otherwise the executables can be found in the Applications folder.
EDIT:
Sometimes it helps to run a cleanup to delete the old versions:
brew cleanup
brew cask cleanup
I need to install ruby 2.0.0-p645 and I use rbenv. I tried downloading it by running
rbenv install 2.0.0-p645
But the internet in my college keeps dropping every few minutes, so the transfer was always closing with some 11MB remaining.
To counter that, I saw the url from where rbenv was downloading, and used wget to download the source file that rbenv was downloading. (using wget -c for resuming every time the connection closed).
Now I have the file, is there a way to install that ruby version now?
The file's link on cloudfront that I have on my machine.
Yes. Put the downloaded file into ~/.rbenv/cache. You might need to create the directory first. Then run your rbenv install command again. Here is the link to the documentation for this: https://github.com/rbenv/ruby-build#package-download-caching
To summarize, for future reference:
Download the file using wget
Create a cache folder in ~/.rbenv/ if it doesn't exist already.
Rename the downloaded file to ruby-x.y.z-pabc.tar.gz. Extract it and move it to ~/.rbenv/cache/
Run rbenv install x.y.z-pabc
For me, the following steps work.
1 Download the file using `wget/curl or any other way`
2. Create a `cache` folder in `~/.rbenv/` if it doesn't exist already.
3. Move the downloaded file to `~/.rbenv/cache/`
4. Run `rbenv install x.y.z` (ex. rbenv install 2.7.1`)
The difference from the above answer was,
- do not need to change file name
- do not need to extract
- if file rename to something random (ex. x.y.z-pabc) it show ruby-build: definition not found: x.y.z-pabc
Hope this can help someone.
So I've made an edit to the tmux formula in homebrew, but now I'm starting to think about how I can keep that change between machines without forking and maintaining my own version of homebrew.
If I do fork homebrew, I would just have to edit and install script to point to my location, but would the formulas locations still be maintained?
So I guess my question is what are my options here? Should I fork homebrew or just make a note of the changes?
You can make your own tap. The easiest way is to create a repository on GitHub called homebrew-self. Your custom formula goes in the root of the repository. Then, you can use it in Homebrew by running
brew tap <your github username>
If you're modifying a formula that's already in Homebrew, though, the easiest (and best) way is to submit a pull request containing your changes.