A tool that automates the entire process of installing, updating, configuring, and removing software on your computer. Also handling dependencies under the hood
Effortless Management
Without a package manager, you’d have to hunt down software, figure out all its dependencies, install everything in the right order – a tedious and error-prone process. Some may even require you to compile from source which requires a compiling tool chain.
The list below shows the comparison of commands of package managers lik Brew, apt & Pacman etc
Simple Ruby scripts, we can easily revert our modifications and merge upstream updates with brew edit <PACKAGE_NAME>.
Brew Tap
Add additional repositories that extend the core Homebrew installation, so we can install a wider range of command-line tools and utilities. You can list all the repositories brew taps on with brew tap.
Brew Cask
Extension to Homebrew that allow you to install full-fledged macOS GUI applications. You can list all the apps installed with brew cash with brew list --cask.
Brew Bottles
These are pre-compiled binary packages created by Homebrew maintainers or the community. They save you the time and effort of compiling a formula from source code.
Poured from Bottle
When you see a message like “Pouring <package_name>”, it means Homebrew is installing the package using a pre-compiled bottle instead of building it from source.
# Example, set a script called 'pre-commit'npm pkg set scripts.pre-commit="npx prettier . --write && npx oxlint"
package-lock.json
When we install a package, it is recorded as package@^1.11.10, 1.11.10 is using Semantic Versioning. This means if that package releases a new version, and we run npm install, it will grab the newer version without our notice! package-lock.json ensures it doesn’t grab the latest version unless we explicitly ask it to do so. This ensures the dependencies we install across different collaborators are the same.
Paru is a wrapper around Pacman written in Rust. Very similar syntax, zero learning curve.
Package Management
Install packages: pacman -S
Search for a package: pacman -Ss
Upgrade all packages: pacman -Syu
Remove a package: pacman -R
Install package from package-name.pkg.tar.xz
sudo pacman -U package-name.pkg.tar.xz
Basher
A Package Manager for shell scripts. You can install it with curl -s https://raw.githubusercontent.com/basherpm/basher/master/install.sh | bash. Refer to its Github Page for more information
Basic usage
Install package: basher install <github_username>/<project_name> or the full URL to the git repo that isn’t hosted on Github.
Github has many useful tools, but some of them aren’t part of Package Manager we can use on our system. We can still install the executables without compiling ourselves if they offer releases
Install executables from Github releases page
Install the executable using wget -qO package.tbz <GITHUB_PROJECT_URL>/releases/latest/download/<ASSET_FILENAME>.
Then we can decompress the file with tar xf <ASSET_FILENAME>, go into the decompressed folder and move the executable to /usr/local/bin. And now we should be able to call the executable from the Terminal!
Caution
We need to manually update the packages installed.
Nix
Install Nix with sh <(curl -L https://nixos.org/nix/install). You can test your installation with nix-shell -p nix-info --run "nix-info -m" which creates a temporary environment with the nix-info tool installed and executed