- Homebrew
- 02 February 2019
- MikeMcQuaid
- Homebrew Documentation
- Features
- Install
- Brew install SOFT
- Как установить Homebrew?
- Command Line Tools
- Установка homebrew
- Ошибки, баги, глюки, howto
- Отключить сбор информации
- Управление сервисами в homebrew
- Как собрать программу из исходников
- Error: /usr/local must be writable!
- %command% not found
- после обновления до Sierra не работает brew
- Программы из brew
- youtube-dl
- Is it possible to brew install without updating? #1670
- Comments
- wildeyes commented Dec 14, 2016
- bfontaine commented Dec 14, 2016
- bfontaine commented Dec 14, 2016
- bfontaine commented Dec 14, 2016
- bfontaine commented Dec 15, 2016
- bfontaine commented Dec 15, 2016
- MikeMcQuaid commented Dec 18, 2016
- Stubbs commented May 11, 2017
Homebrew
02 February 2019
MikeMcQuaid
Today I’d like to announce Homebrew 2.0.0. The most significant changes since 1.9.0 are official support for Linux and Windows 10 (with Windows Subsystem for Linux), brew cleanup running automatically, no more options in Homebrew/homebrew-core, and removal of support for OS X Mountain Lion (10.8) and older.
Major changes and deprecations since 1.9.0:
- Homebrew officially supports Linux and Windows 10 with Windows Subsystem for Linux (WSL). Homebrew on Linux was previously called “Linuxbrew”. You can install it in your home directory, so it does not require sudo , and use it to install software that your host distribution’s package manager does not provide. Homebrew on Linux uses its own repository for formulae: Homebrew/linuxbrew-core
- brew cleanup is run periodically (every 30 days) and triggers for individual formula cleanup on reinstall, install or upgrade. You can opt-out of this behaviour by setting the HOMEBREW_NO_INSTALL_CLEANUP variable. This addresses a long-standing complaint where users were surprised by how much disk space Homebrew used if they did not run brew cleanup .
- Homebrew does not run on OS X Mountain Lion (10.8) and below. For 10.4 — 10.6 support, see Tigerbrew. This has allowed us to remove large amounts of legacy code.
- Homebrew does not migrate old, pre-1.0.0 installations from the Homebrew/legacy-homebrew (formerly Homebrew/homebrew repository. This has allowed us to delete legacy code that dealt with migrations from old versions.
- Homebrew does not have any formulae with options in Homebrew/homebrew-core. Options will still be supported and encouraged by third-party taps. This change allows us to better focus on delivering binary packages rather than options. Formulae with options had to be built from source, could not be tested on our CI system and provided a disproportionate support burden on our volunteer maintainers.
Other changes since 1.9.0 I’d like to highlight are the following:
Also, if you’ve not tuned in since 1.0.0, here are the major changes since then:
- Rubocop-supporting editors (e.g. VS Code, Atom) can get inline brew audit information when editing formulae in taps. This improves the contribution experience.
- A brew tap-new command is available for creating a new tap with a READMEand preconfigured Azure Pipelines configuration (which seems to provide the most reliable and performant macOS CI for OSS at the time of writing). This eases the creation of taps (third-party repositories).
- brew update-reset resets all repositories and taps to their upstream versions. This is useful when debugging git issues.
- brew link state is preserved after brew install and brew upgrade (including for keg-only formulae) but unfortunately not the brew unlink state due to a lack of state. This should allow many keg-only formulae to be used as if they are normal formulae.
- Homebrew filters all user environment variables. This reduces errors when formulae are built from source and allows the removal of many workarounds for niche issues.
- brew postgresql-upgrade-database upgrades PostgreSQL database data between major versions. This simplifies upgrades between PostgreSQL versions which previously required a semi-manual process and old version of PostgreSQL to be kept around.
- The python formula was upgraded to Python 3.x and python@2 formula was added for installing Python 2.7. We initially did not comply with PEP 394 and this was a mistake. We made brew install python and brew install python@2 PEP 394 compliant and will not change this again until PEP 394 has changed. This allows us to migrate more of our ecosystem to Python 3.
- We deprecated and archived all the Homebrew organisation taps and created new and versioned formulae in Homebrew/homebrew-core. We encourage more niche formulae and formula options to be supported in taps outside the Homebrew organisation. This allows us to focus on providing high-quality formulae that work consistently rather than a long-tail of broken, unsupported, ignored formulae.
- Homebrew Formulae is a site providing formulae data, anonymous aggregate analytics data and a JSON API querying these. This allows you to quickly query Homebrew information without access to macOS or Homebrew.
- In July 2018 a security researcher identified a GitHub personal access token leak from Homebrew’s Jenkins. Within a few hours the credentials had been revoked and sanitised. No packages were compromised and no action was required by users due to this incident. We are currently attempting to migrate away from Jenkins to a suitable hosted CI provider.
- When a bottle isn’t available for your version of macOS we will use a bottle from an older version instead. This will make life much more pleasant on new macOS releases before our bottling has completed (or when formulae fail to build).
- brew upgrade automatically reinstalls or upgrades formulae with broken linkage. This avoids broken formulae when building from source or using optional behaviour after upgrades.
- brew info displays analytics data. This is the way that Homebrew maintainers query analytics data so we are using the same data as the community.. This will hopefully ease concerns about our collection of analytics data.
- Homebrew Cask’s downloads are quarantined. This provides the same level of security when downloading these tools manually.
- Homebrew/homebrew-core requires all formulae to be open source by the OSI definition. This allows you to be confident that any brew install (although not brew cask install ) from Homebrew/homebrew-core is open source software.
- brew link —force will not link software already provided by macOS but instead output the instructions on how to do so. This avoids strange compilation errors and encourages users to use the system mechanisms for adjusting their PATH .
- Many Homebrew maintainers will be attending FOSDEM 2019 (say hello!) and meeting afterwards on 4th February to discuss the future governance of Homebrew.
- Homebrew still accepts donations through Patreon. If you can afford it, please consider donating. If you’d rather not use Patreon (our preferred donation method), check out the other ways to donate in our README.
Thanks to all our hard-working maintainers, contributors, sponsors and supporters for getting us this far. Enjoy using Homebrew!
Homebrew Documentation
The Homebrew package manager may be used on Linux and Windows Subsystem for Linux (WSL). Homebrew was formerly referred to as Linuxbrew when running on Linux or WSL. It can be installed in your home directory, in which case it does not use sudo. Homebrew does not use any libraries provided by your host system, except glibc and gcc if they are new enough. Homebrew can install its own current versions of glibc and gcc for older distributions of Linux.
Features, installation instructions and requirements are described below. Terminology (e.g. the difference between a Cellar, Tap, Cask and so forth) is explained in the documentation.
Features
- Can install software to your home directory and so does not require sudo
- Install software not packaged by your host distribution
- Install up-to-date versions of software when your host distribution is old
- Use the same package manager to manage your macOS, Linux, and Windows systems
Install
Instructions for a supported install of Homebrew on Linux are on the homepage.
The installation script installs Homebrew to /home/linuxbrew/.linuxbrew using sudo if possible and in your home directory at
/.linuxbrew otherwise. Homebrew does not use sudo after installation. Using /home/linuxbrew/.linuxbrew allows the use of more binary packages (bottles) than installing in your personal home directory.
The prefix /home/linuxbrew/.linuxbrew was chosen so that users without admin access can ask an admin to create a linuxbrew role account and still benefit from precompiled binaries. If you do not yourself have admin privileges, consider asking your admin staff to create a linuxbrew role account for you with home directory /home/linuxbrew .
Follow the Next steps instructions to add Homebrew to your PATH and to your bash shell profile script, either
/.profile on Debian/Ubuntu or
/.bash_profile on CentOS/Fedora/Red Hat.
You’re done! Try installing a package:
If you’re using an older distribution of Linux, installing your first package will also install a recent version of glibc and gcc. Use brew doctor to troubleshoot common issues.
Brew install SOFT
Как установить Homebrew?
Command Line Tools
Как два байта переслать.
Вначале необходимо установить инструменты командной строки для разработчиков (Command Line Tools). Для этого ставим Xcode из Mac App Store или скачиваем с сайта developer.apple.com
Либо ничего не скачиваем, а просто в terminal выполняем
Установка homebrew
Памятка для себя по основным командам
Команда | Описание |
---|---|
brew update | Обновить brew |
brew list | Список установленного ПО через brew |
brew uninstall htop | Удалить программу |
brew outdated | Проверить обновление для программ установленных через brew |
brew upgrade | Обновить все программы |
brew pin htop | Если нужно обновить всё кроме определенной программы |
brew upgrade htop | Обновить только программу htop |
brew remove –force $(brew list) brew remove –force $(brew list) –ignore-dependencies | Удалить все установленные пакеты |
brew cleanup | После при желании можно удалить скаченные архивы |
Ошибки, баги, глюки, howto
Отключить сбор информации
Управление сервисами в homebrew
Как собрать программу из исходников
Установить nmap из исходных кодов
Переустановить/собрать все программы установленные через brew
Error: /usr/local must be writable!
При запуске brew doctor появляется сообщение Error: /usr/local must be writable!
%command% not found
При этом если указывать полный путь к бинарнику, то успешно запускается
и чтобы не перелогиниваться применяем сразу изменения
Бонус. Избавляемся от ошибки mtr: unable to get raw sockets.
UPD Не работает в Sierra.
после обновления до Sierra не работает brew
Программы из brew
Must have программы по отзывам маководов
Мой brew список
youtube-dl
Примеры использования
Скачать видео без опций
Смотрим доступные форматы и качество
Чтобы скачать видео 1280×720 hd720 под номером 22 используем ключ -f
Чтобы скачать плейлист достаточно просто указать ссылку
Скачиваем плейлист с дополнительными опциями
- A, –auto-number. deprecated. Use -o «%(autonumber)s-%(title)s.%(ext)s» instead.
- c, –continue — продолжить загрузку в случае обрыва связи
- f, –format — код формата видео
- i, –ignore-errors — игнорировать ошибки и продолжить загрузку
- t, –title — заголовок в имени файла. deprecated. теперь по-умолчанию
Deprecated! Make sure you are not using -o with any of these options -t, –title, –id, -A or –auto-number set in command line or in a configuration file. Remove the latter if any.
Is it possible to brew install without updating? #1670
Comments
wildeyes commented Dec 14, 2016
brew install —help doesn’t say anything about this.
The text was updated successfully, but these errors were encountered:
bfontaine commented Dec 14, 2016
It’s documented in the manpage ( man brew ):
bfontaine commented Dec 14, 2016
BTW, if this is an env variable, it will effect subsequent calls?
Only if you export the variable and stay in the same shell. Compare e.g.:
bfontaine commented Dec 14, 2016
You can export the variable in your shell startup script (e.g.
/.bashrc ); it’ll apply to all shell sessions.
/.bashrc); it’ll apply to all shell sessions. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .
bfontaine commented Dec 15, 2016
Then prefix each command with HOMEBREW_NO_AUTO_UPDATE=1 ; it’ll affect only that particular command.
If you use Homebrew/aliases you can setup an alias for this use-case:
(you may want to use a shorter command name 😄 )
bfontaine commented Dec 15, 2016
It’s often something you want globally; not per command. Additionally it’s handled at the brew.sh level and not by the command itself to ensure no Ruby code is loaded before updating.
cc @MikeMcQuaid for an opinion on this.
MikeMcQuaid commented Dec 18, 2016
This should also be documented in the —help for install, I think.
@wildeyes Sorry, I don’t agree. This isn’t something we want most users to disable.
You can temporarily run export HOMEBREW_NO_AUTO_UPDATE=1 in a shell session if you wish to disable auto-update just for that session. A better alternative may be instead to set HOMEBREW_AUTO_UPDATE_SECS to a higher value (the default is to try and update every 60 seconds).
Stubbs commented May 11, 2017
Here’s a use case:
We have scripts per project that setup the environment. Most projects have a specific version of Node that they require so as part of each projects bootstrap we install Node to get npm, then use npm to install a thing called «n», an easy NodeJS version switcher.
The problem comes when I switch to another project, when it’s bootstrap gets to node it tries to update it to the latest version of node which fails because it can’t symlink it in to place.
We use Brewfiles to control what gets installed, and it’s only really Node we want to pin to a certain version but using the env var would restrict all the others too.
Would be nice if I could just add —no-update to a single line.