Abstract
- 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.
Brew
- The Package Manager for MacOS
- Install with
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Interesting analytics data
Package Management
List all the installed packages:
brew list
Check for outdated package:
brew outdated
Upgrade all packages:
brew upgrade
Check for deprecated packages:
brew doctor
Brew Formula
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.
Pipx
- Package Manager for Python Applications
- Install with Brew -
brew install pipx && pipx ensurepath
Package Management
List all the installed packages:
pipx list
Upgrade all packages:
pipx upgrade-all
Caution
Currently, there isn’t a way to check for outdated packages. Refer to this issue for more updates on this matter.
NPM
- Package Manager for Node.js Applications
- Come with NVM
Package Management
npm list -g
- list all the installed packages
npm update -g
- update all the packages
npm outdated -g
- check for outdated packages
Obtain the absolute path to global node modules
Manage
package.json
With the use of npm pkg
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 runnpm 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.
Cargo
- Package Manager for Rust, installed along with the Rust Toolset
Package Management
ls ~/.cargo/bin
- list all the installed packagesUpdating packages - Cargo doesn’t come with a command to upgrade installed packages. We need to re-install the packages to update the packages.
Pacman
- Package Manager for Arch distros
Pacman on Tren!
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
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.Uninstall package:
basher install <github_username>/<project_name>
Check for outdated package:
basher outdated
Upgrade all packages:
basher upgrade --all
Download from 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.