How To

How to Fix “Error: Unknown command: cask” in brew

I got the error message “Error: Unknown command: cask” while trying to install multipass using brew cask command. This is as shared in code section:

Original content from computingforgeeks.com - post 83810
$ brew cask install multipass
Error: Unknown command: cask

The reason you’ll get this error is that cask is no longer a brew command. Whenever you want to install a Cask, you will run the command:

brew install <package>
# OR
brew install --cask <package>

Instead of brew cask install. So let’s rerun the installation and see the results:

$ brew  install --cask multipass
==> Downloading https://github.com/CanonicalLtd/multipass/releases/download/v1.6
==> Downloading from https://github-releases.githubusercontent.com/114128199/4dd
######################################################################## 100.0%
==> Installing Cask multipass
==> Running installer for multipass; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
installer: Package name is multipass
installer: Installing at base path /
installer: The install was successful.
🍺  multipass was successfully installed!

Reading brew help pages is also helpful when you encounter any error while using the command. Here are common ways of getting help:

brew help
man brew
brew help <command>

See brew common usage examples:

$ brew help
Example usage:
  brew search TEXT|/REGEX/
  brew info [FORMULA|CASK...]
  brew install FORMULA|CASK...
  brew update
  brew upgrade [FORMULA|CASK...]
  brew uninstall FORMULA|CASK...
  brew list [FORMULA|CASK...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA|CASK

Contributing:
  brew create URL [--no-fetch]
  brew edit [FORMULA|CASK...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

I hope this guide was of importance to you in bypassing the error stated while trying to install a package using brew package manager on macOS. The error “error: unknown command: cask” should be no issue from now onwards.

More guides on macOS are shared in the links below:

Courses to Learn Linux System Administration:

Keep reading

macOS Keyboard Shortcuts Cheat Sheet (Golden Gate and Tahoe) Cheat Sheets macOS Keyboard Shortcuts Cheat Sheet (Golden Gate and Tahoe) Fix “apt-key is deprecated. Manage keyring files in trusted.gpg.d instead” Debian Fix “apt-key is deprecated. Manage keyring files in trusted.gpg.d instead” Linux Terminal Shortcuts Cheat Sheet (Bash and zsh) Cheat Sheets Linux Terminal Shortcuts Cheat Sheet (Bash and zsh) Run macOS and Linux VMs with UTM on Apple Silicon macos Run macOS and Linux VMs with UTM on Apple Silicon Best NAS for Mac Time Machine Backups macos Best NAS for Mac Time Machine Backups Google Search from a Linux Terminal using googler Terminal Google Search from a Linux Terminal using googler

Leave a Comment

Press ESC to close