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:

Related Articles

FreeBSD Install Bashtop – Terminal Resource Monitor for Linux | macOS | FreeBSD Terminal How To Run Linux Terminal on Web Browser using Wetty Desktop Best PDF to Image Converter on Windows and Mac macos Count Lines of Source Code on Linux Using Tokei

Leave a Comment

Press ESC to close