mirror of
https://github.com/jbranchaud/til
synced 2026-01-04 23:58:01 +00:00
Add Clean Up Your Brew Installations as a Brew TIL
This commit is contained in:
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||||
|
|
||||||
_1664 TILs and counting..._
|
_1665 TILs and counting..._
|
||||||
|
|
||||||
See some of the other learning resources I work on:
|
See some of the other learning resources I work on:
|
||||||
|
|
||||||
@@ -125,6 +125,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
|||||||
|
|
||||||
### Brew
|
### Brew
|
||||||
|
|
||||||
|
- [Clean Up Your Brew Installations](brew/clean-up-your-brew-installations.md)
|
||||||
- [Configure Brew Environment Variables](brew/configure-brew-environment-variables.md)
|
- [Configure Brew Environment Variables](brew/configure-brew-environment-variables.md)
|
||||||
- [Export List Of Everything Installed By Brew](brew/export-list-of-everything-installed-by-brew.md)
|
- [Export List Of Everything Installed By Brew](brew/export-list-of-everything-installed-by-brew.md)
|
||||||
- [List All Services Managed By Brew](brew/list-all-services-managed-by-brew.md)
|
- [List All Services Managed By Brew](brew/list-all-services-managed-by-brew.md)
|
||||||
|
|||||||
40
brew/clean-up-your-brew-installations.md
Normal file
40
brew/clean-up-your-brew-installations.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Clean Up Your Brew Installations
|
||||||
|
|
||||||
|
Over time as you upgrade brew-installed programs and make changes to your
|
||||||
|
`Brewfile`, your machine will have artifacts left behind that you no longer
|
||||||
|
need.
|
||||||
|
|
||||||
|
Periodically, it is good to clean things up.
|
||||||
|
|
||||||
|
First, you can get a summary of stale and outdated files that brew has
|
||||||
|
installed. Use the `--dry-run` flag.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ brew cleanup --dry-run
|
||||||
|
```
|
||||||
|
|
||||||
|
If you feel good about what you see in the output, then give things a clean.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ brew cleanup
|
||||||
|
```
|
||||||
|
|
||||||
|
Second, if you are using a `Brewfile` to manage what `brew` installs, then you
|
||||||
|
can instruct `brew` to uninstall any dependencies that aren't specified in that
|
||||||
|
file.
|
||||||
|
|
||||||
|
By default it operates as a dry run and the `--force` flag will be needed to
|
||||||
|
actually do the cleanup. And specify the filename if it doesn't match the
|
||||||
|
default of `Brewfile`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ brew bundle cleanup --file=Brewfile.personal
|
||||||
|
```
|
||||||
|
|
||||||
|
If the output looks good, then force the cleanup:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ brew bundle cleanup --force --file=Brewfile.personal
|
||||||
|
```
|
||||||
|
|
||||||
|
See `brew cleanup --help` and `brew bundle --help` for more details.
|
||||||
Reference in New Issue
Block a user