installs stuff / package manager for macOS (or Linux)
brew services list
brew update
Simon says: "run this every day":
brew update && brew upgrade && brew cleanup --prune 0
-> updates brew, updates everything installed with brew and throws everything redundant away.
brew reinstall example-package
brew autoremove
- cleans up packages that were installed as dependencies of other packages but are no longer needed. When you install a package that depends on other packages, Homebrew automatically installs those dependencies. However, if you later uninstall the main package, those dependencies might remain on your system, taking up space even though they're no longer required.
- Identifies Unused Dependencies: It checks for packages installed solely as dependencies for other packages that have since been removed.
- Removes Unneeded Packages: It removes these unused dependencies, freeing up disk space.
- Keeps Your System Clean: This helps keep your Homebrew environment lean by removing packages you aren’t actively using.
Running brew autoremove is a safe way to reclaim storage without affecting the software you currently use. You can run it periodically after uninstalling software to keep your system clean.
The proper way to remove a Homebrew package is with the uninstall or remove command.
The uninstall Homebrew package command looks like this:
brew uninstall packageName
The remove Homebrew package command looks like this:
brew remove packageName
As you may have guessed by now, the remove and uninstall commands are exactly the same, and get the same result; the removal of the Homebrew package.
For example, to remove and uninstall Telnet (assuming you installed telnet on the Mac with Homebrew anyway), you would use the following command string:
brew uninstall telnet
Or you can use the remove command for the same effect:
brew remove telnet
Removing a package from Homebrew is quick, as there is no need to download anything, it just deletes the Homebrew package from the Mac.
You can confirm the package was removed by trying to run the command again, or by checking where Homebrew packages are installed to and you will find the package you removed is no longer there.
source: https://osxdaily.com/2018/07/29/uninstall-packages-homebrew-mac/
When downloading / installing a language or tool on mac: when is it more advisable to do it from the respective homepage and when to use homebrew? Is there a rule of thumb? And what are the dis-/ advantages of one or the other? –––
While "casks" are used for software with GUIs and macOS-specific software, "formulae" are generally used for command-line utilities and libraries, many of which can be installed across different operating systems.
The terms "formula" and "cask" play into the brewing metaphor that Homebrew employs. Just as a brewer would follow a specific formula to create a beverage and might use a cask to store certain drinks, Homebrew follows the instructions in its formulae and casks to "brew" software.
Both formulae and casks have scripts that detail where to fetch the software and any post-installation steps. However, there are some differences in their typical use cases and the details they handle:
-
Where to fetch the software's source code: Both formulae and casks specify this. While formulae often download source code to compile, casks typically download precompiled binaries or application bundles (like
.dmgor.pkgfiles). -
Which dependencies are needed: This is more typical for formulae, which might need various libraries or other tools to compile or run. Casks can also have dependencies (or even depend on formulae), but it's less common since they usually deal with standalone macOS applications.
-
How to compile and install the software: This is mainly a formula concern. Formulae often involve compilation steps since they're working from source code. Casks, dealing mostly with precompiled applications, focus more on installation steps like copying the
.appbundle to the/Applicationsdirectory or running a.pkginstaller. -
Post-installation steps or patches: Both formulae and casks can have post-installation steps. For formulae, it might be about setting up certain files or directories. For casks, it might be about granting specific permissions or setting up linked applications.
–––
sources:
- working with Simon
interesting: