-
Notifications
You must be signed in to change notification settings - Fork 5
homebrew and linuxbrew formula Notes
ipatch edited this page Apr 19, 2018
·
48 revisions
- General homebrew usage
- Homebrew Cask
- Working with Python 2.x / 3.x
- Build time options / parameters
- Useful Links
- TODOs
To remove soure tarballs and downloaded .DMGs for homebrew and cask
```fish
brew cleanup
brew cask cleanup
```
...will remove downloaded tarballs and image files stored within the below directory
```fish
$HOME/Library/Caches/Homebrew
```
To show outdated formula for homebrew
```fish
brew outdated
brew cask outdated
```
To print a list of sources tapped for homebrew usage
```fish
brew tap
```
To print a pretty π list of installed Homebrew formula and their dependencies in a graphical format
```fish
brew deps --tree --installed
```
[More information](https://docs.brew.sh/Taps) for working with taps
<a href="homebrew-cask"></a>
## homebrew cask
> β οΈ [Homebrew cask](https://caskroom.github.io/) is not the SAME thing as [emacs cask](https://cask.readthedocs.io/en/latest/index.html)
<a href="homebrew-cask-installation"></a>
### Homebrew-Cask _Installation_
To install Homebrew-Cask via [Homebrew](http://brew.sh)
```fish
brew tap caskroom/cask
```
### [Homebrew-Cask Versions](https://github.com/caskroom/homebrew-versions) _Installation_
To install the above mentioned repo
```fish
brew tap caskroom/versions
```
To install a cask from caskroom/versions/hyper-canary
```fish
brew cask install hyper-canary
```
<a href="working-with-python-2-3"></a>
## Working with Pythons - 2.x 3.x
### Initial Setup
> After installing python via homebrew and is properly configured in the `PATH`
```fish
python -m pip install --upgrade setuptools
```
```fish
python -m pip install --upgrade pip
```
> β οΈ When using the `--user` flag with `pip` on macOS packages, ie. `virtualenv` will be placed in `$HOME/Library/Python/[major.minor]/bin/
Homebrew can install concurrent Pythons on the local system.
Homebrew seperates the pythons by creating seperate binaries, ie.
python 2.x is located at
```fish
/usr/local/opt/python/libexec/bin/python
```
and python 3.x is located at
```fish
/usr/local/bin/python3
```
Both pythons use a seperate `pip` package to manage python dependencies, ie. python 2.x uses
```fish
/usr/local/opt/python/libexec/bin/pip
```
and python 3.x uses
```fish
/usr/local/bin/pip3
```
<a href="python-useful-links"></a>
### Python Useful Links
[Homebrew documentation - Python](https://docs.brew.sh/Homebrew-and-Python.html)
<a href="build-time-options"></a>
## Build time options / parameters
To show build time options for a homebrew formula
```fish
brew info [mr_fancy_pants_formula]
```
> brew info weechat
<a href="working-with-homebrew-casks"></a>
## Working with homebrew casks
To search for a brew formula from a cask, ie. `kodi`
```fish
brew search kodi
```
Output:
```fish
brew search kodi 0 < 14:24:28
==> Searching local taps...
==> Searching taps on GitHub...
caskroom/cask/kodi caskroom/versions/kodi-development
==> Searching blacklisted, migrated and deleted formulae...
```
Then to install kodi
```fish
brew cask install kodi
```
---
Homebrew π» formula are stored in the following location on macOS (10.12.6)
```shell
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
```
However, linuxbrew formula are more than likely located at the below path on Debian Jessie
```shell
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
```
To edit a formula, make sure the `$EDITOR` environment variable is set to your favorite text editor, ie. in the fish shell,
```shell
set -x EDITOR /path/to/your/favorite/editor
```
Example
```shell
set -x EDITOR /home/linuxbrew/.linuxbrew/bin/nvim
```
Then one can edit the formula of choosing with the below command,
```shell
brew edit <name_of_formula.rb>
```
Example
```shell
brew edit weechat.rb
```
To list all installed packages with homebrew π»
```fish
brew list
brew cask list
```
To get the SHA 256 hash of a file
```fish
shasum -a 256 <name_of_file> | awk '{printf 1γγ«}' | pbcopy
```
<a href="useful-links"></a>
## Useful Links π
- [Official - search for formula](http://formulae.brew.sh/)
- [How to Create and Maintain a Tap](https://github.com/Homebrew/brew/blob/master/docs/How-to-Create-and-Maintain-a-Tap.md)<br />
- [Formula Cookbook for developers](https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md)<br />
- [Python for Formula Authors](https://github.com/Homebrew/brew/blob/master/docs/Python-for-Formula-Authors.md)<br />
- [A deep dive π into homebrew dependencies](http://blog.jpalardy.com/posts/untangling-your-homebrew-dependencies/)
<a href="todos"></a>
## TODOs
- [x] add entries to table of contents for this .md file
- [ ] figure out which binaries belong to which packages, ie. which package installed `locate`
-
Linux and macOS Operation Notes
- β macOS Op Notes
- π§ Linux Op Notes
- Vim & Neovim Notes
- git Notes
- π fish shell Notes
- ECMAScript Tooling
- π₯§ Raspberry Pi Notes
- asdf version manager Notes
- Bind9 Notes
- Creating a custom motd on Debian Jessie
- ECMAScript Tooling
- Email client Notes
- Email Server Setup Notes Postfix & Dovecot
- Emoji side quest
- fish shell Notes
- π₯ π€ git it got it good Notes
- git Notes
- Graphics and Image Processing Notes
- GUI text editor Notes
- π»π§ Homebrew and Linuxbrew formula Notes
- Linux and macOS Administration Notes
- Linux and macOS Troubleshooting Notes
- MacBook Pro Late 2013 Notes
- Vim & Neovim Notes
- Video Production Notes
- Python Notes
- radare Notes
- Raspberry Pi Notes
- Terminal Emulators
- Tmux Notes
- Web Browser Notes
- Weechat Notes
- Microsoft Windows Notes