Quick reference for backing up and restoring installed packages.
- Homebrew
- Python
- R
- Ruby
Quick reference for backing up and restoring installed packages.
Dump installed packages and cask to a Brewfile
homebrew-bundle (aka Brewdler/Brew Bundler) which replaces the deprecated brew bundle
command:
brew bundle dump
Check a Brewfile
against what is currently installed:
brew bundle check
Install dependencies from Brewfile
in the current directory:
brew bundle
Show all Homebrew formulae not listed in Brewfile
(use --force
to uninstall them):
brew bundle cleanup
Export conda and pip packages from a conda environment (note: environments with conda env list
):
conda env export -n root > environment.yml # or other conda environment
Note: conda list -e
also outputs requirement strings, and these explicit spec files seem identical except they do not include pip
packages. For some reason they are not usually cross-platform and indicate the platform in a comment. Also possible difference in how they handle channels?
Create environment (may need to specify name):
conda env create -f environment.yml
Create requirements file:
pip freeze > requirements.txt`
Install packages from the file:
pip install -r requirements.txt
See also: pip list
, yolk
List local gems:
gem list [--no-versions]
Display detailed information with -d, --details
flags.
List which other gems a gem depends on:
gem dependency [--reverse-dependencies]
Bundler is a useful tool for tracking gems and their versions. How does this work? I vaguely recall hearing about Gemfile support in gem itself, but I couldn't find the reference...
For fun you can get a dependency graph from Bundler/Gemfile (requires graphviz):
gem install ruby-graphviz bundle viz