Skip to main content

📦 Package Managers

This page defines the fundation of the package manager ecosystem.

Pacakage ManagerCLIsInstallableSourceGlobalProjectWebsite
DebianaptPackagePPAUbuntu Packages Search
HomebrewbrewFormula / Formulae / Cask 1TapHomebrew
PythonpipModuleURLPyPI
npmnpmPackagenpm
Rubygem, bndleGemURIRubyGems
GogoPackageGo Packages

Exploring

Dependency

List all dependencies of an installable.

In another word, find out a package depend on which other packages.

apt depends _
warning

For npm, you need to install the package first before you can list its dependencies. In addition, this command is expected change in the future.

Information

Show or view the information of an installable.

apt show _

Reverse Dependency

List all dependent installables of a installable.

In another word, find out which installables are using / depend by a installable specified.

apt rdepends _

Find an installable.

apt search _

Install

Install Globally

Globally install an installable on the environment.

apt install _

Install from List

Install installables from a list of file, file name varies by convention.

xargs -a Aptfile apt install

Install Project

Install installables for a project, file name varies by convention.

# N/A

Upgrade

Upgrade

Upgrade an installable.

apt upgrade _

Upgrade All Globally

Upgrade all global installables.

apt upgrade
info

The pip commands is modified from this StackOverflow answer.

Uninstall

Uninstall

Uninstall an installable.

apt remove _

Uninstall All

Uninstall all global installables.

apt remove --purge $(dpkg -l | grep '^rc' | awk '{print $2}')
info

The credits for npm commands go to this StackOverflow answer.

Uninstall Useless

Uninstall useless packages that are not required or not used.

warning

Always manually test after running this command to ensure that your project still works as expected.

apt autoremove

Listing

List Globally Installed

List all globally installed packages.

apt list --installed

List Globally Undepend

List all global packages that are not dependencies of any other global package.

tip

Installable listed by this command typically are not needed anymore and can be removed.

# Open a PR to complete this 🫶🏻

List Globally Upgradable

List all global packages that have updates available.

apt list --upgradable

List Installed (Project)

List all installed packages in the current project.

# N/A

List Upgradable (Project)

List all upgradable packages in the current project.

# N/A

Source

Add Source

Add sources to the package manager to install packages from the new source.

add-apt-repository _

List Sources

List all sources where installables can be installed from.

apt policy
info

If the pip command yield ERROR: No such key, it means the source is the default index url, which is https://pypi.org/simple.

Remove Source

Remove a source from the list of sources used to resolve packages.

add-apt-repository --remove _

Update

Update installable information from the sources.

apt update

Mainenance

Cleanup All Cache

Clean up all cache. Does not remove any packages.

apt clean

Cleanup Useless Cache

Clean up useless cache. Does not remove any packages.

apt autoclean

Healthcheck

Run a healthcheck / diagnosis to verify the package manager / installation is working correctly.

# Open a PR to complete this 🫶🏻

Footnotes

  1. Homebrew refers to its installables as formula/formulae, which is normally a CLI tool, and cask for everything else, like apps, fonts, and such.