Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to freeze brew requirements like pip?

Is there a way or a special command in brew to freeze the installed packages into a requirements.txt file, just like you can with pip in python? And then to quickly reinstall them all from that file?

like image 728
M.R. Avatar asked Feb 22 '16 00:02

M.R.


People also ask

How do I freeze requirements for pip?

The recommended approach is to use a requirements. txt file (readthedocs.org) that contains a list of commands for pip that installs the required versions of dependent packages. The most common command is pip freeze > requirements. txt , which records an environment's current package list into requirements.

How does pip freeze work?

pip freeze is a very useful command, because it tells you which modules you've installed with pip install and the versions of these modules that you are currently have installed on your computer. In Python, there's a lot of things that may be incompatible, such as certain modules being incompatible with other modules.

How do you unfreeze pip?

You just need to delete the venv folder and initialize new one.


1 Answers

Use Homebrew-bundle; it’s designed for that.

# generate a Brewfile
$ brew bundle dump
$ ls
Brewfile

# check everything is installed
$ brew bundle check
The Brewfile's dependencies are satisfied.

It works with both local formulae files and a global one for the current user. It allows you to install everything specified in a Brewfile (that’s the default you can use whatever name you like) as well as uninstall what’s installed but not listed in the file. The file not only list installed formulae but also installed taps (e.g. homebrew/versions, homebrew/php, etc) and casks (if you use Homebrew Cask).

like image 161
bfontaine Avatar answered Oct 08 '22 01:10

bfontaine