Homebrew Cask

repository·main·Indexed 12 days ago

https://github.com/homebrew/homebrew-cask

An extension of the Homebrew package manager for automating the installation and management of prebuilt software artifacts, including GUI apps, fonts, and plugins on macOS and Linux. Includes a suite of CLI utilities for cask creators to identify bundle IDs, package identifiers, launchjob IDs, and appcast URLs for use in Cask uninstall stanzas and livecheck blocks.

Tokens
7.2K
Snippets
40
Records
46
Agent score
96%

What's inside Homebrew Cask

  1. Install and manage prebuilt software with Homebrew Cask

    main

    Homebrew Cask is an extension of Homebrew that provides a CLI workflow for installing and managing prebuilt software artifacts on macOS and Linux. This includes GUI applications, CLI tools, fonts, plugins, and other packaged software distributed by upstream vendors.

    To use Homebrew Cask, you must have Homebrew already installed on your system.

  2. Install a cask using brew install

    main

    You can install applications (casks) directly from the terminal using the brew install command followed by the name of the cask. This automates downloading, verifying, and moving applications to the appropriate directories (e.g., /Applications).

    % brew install alfred
  3. Update and Upgrade Casks

    main

    Homebrew Cask is a tap, so running brew update pulls the latest cask definitions.

    To manage installed applications:

    • brew outdated --cask: Lists casks that have newer versions available.
    • brew upgrade --cask: Upgrades all outdated casks.

    Note on Greedy Casks: Many applications update themselves automatically. These are ignored by brew outdated and brew upgrade. To force Homebrew to manage these, add the --greedy flag.

    $ brew update
    $ brew outdated --cask
    $ brew upgrade --cask
    $ brew upgrade --cask --greedy
  4. Configure Cask installation defaults via HOMEBREW_CASK_OPTS

    main

    You can set persistent default options for cask installations using the HOMEBREW_CASK_OPTS environment variable in your shell profile (.profile, .bash_profile, or .zprofile).

    Commonly configured options include:

    • --appdir=<path>: Changes the directory where applications are moved (default: /Applications).
    • --fontdir=<path>: Changes the path for fonts (default: ~/Library/Fonts).

    Command-line flags will override these environment variable settings.

    # Specify your defaults in this environment variable
    export HOMEBREW_CASK_OPTS="--appdir=~/Applications --fontdir=/Library/Fonts"
  5. Troubleshoot `Checksum does not match` errors

    main

    A checksum mismatch error indicates that the downloaded file does not match the expected hash defined in the Cask. This usually means:

    1. The download was incomplete or corrupted.
    2. The Cask is outdated and needs to be updated to match a new version of the software.
    Error: Checksum for Cask 'your-cask' does not match.
    
    Expected: 3dbc6c2205af35db5370c7642b9a2b833668880569b9c64a7f5a670bf9911130
    Actual: 526d747d99a93b760f7965e25a57ed61de9b93d566a0ba0c5f1c7e83719b20fd
  6. Troubleshoot Homebrew Cask issues

    main

    Before reporting a bug, follow these steps to ensure the issue is not caused by an outdated local setup:

    1. Reset and update your taps and Homebrew state:
      brew update-reset && brew update
    2. Try your command again.
    3. Search existing issues on GitHub to see if the problem is already known.

    If the problem persists, common errors include curl errors, Permission denied errors, Checksum does not match errors, and source is not there errors.

    brew update-reset && brew update
  7. What to do if your issue was closed without review

    main

    If your issue in the homebrew-cask repository was closed without review, it is likely because the required instructions or the bug report issue template were not followed correctly.

    To resolve this, you should:

    1. Review the guides: Go back to the reporting bugs section of the README and ensure your report meets all requirements.
    2. Open a new issue: Once you have followed the instructions, it is acceptable to open a new issue with the correct information.
    3. Appeal a decision: If you believe the maintainer was incorrect to close your issue, reply to the closed issue stating your reasoning. Closing an issue does not end the conversation.
    4. Improve documentation: If the guides were unclear, open an issue or pull request specifically addressing the confusion before opening your original bug report.
  8. Troubleshoot `curl` errors during download

    main

    If you see a curl error (e.g., 403 Forbidden), the issue is related to the download process rather than Homebrew Cask itself. This is typically caused by:

    1. The software vendor's server or the specific file being unavailable.
    2. An outdated Cask definition.
    3. Local network or connection issues.
    curl: (22) The requested URL returned error: 403 Forbidden
  9. Troubleshoot `source is not there` errors

    main

    If you see an error stating the App source is not there, it means the directory structure inside the application's archive has changed. This is a Cask definition issue that requires a fix within the Homebrew Cask repository.

    It seems the App source '/usr/local/Caskroom/someapp/0.1/Someapp.app' is not there.