You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac系统报错“No such keg: /usr/local/Cellar/imagemagick”如何解决?

Fixing "Error: No such keg: /usr/local/Cellar/imagemagick" on Mac

Let's break down how to resolve this issue completely, since you've already started installing imagemagick@6 but hit the truncated keg-only prompt.

What's going on here?

The initial error means your system can't locate an ImageMagick installation in /usr/local/Cellar/imagemagick—either it was never installed, or it was removed. When you installed imagemagick@6, Homebrew marked it as keg-only because it's an alternate version of the main imagemagick formula (which defaults to v7.x these days). This means it won't automatically create symlinks in /usr/local/bin (where your system looks for commands) to avoid conflicts with the newer default version.

Complete Step-by-Step Fix

  1. Confirm the installation status
    First, verify that imagemagick@6 installed correctly by running:

    brew info imagemagick@6
    

    You’ll see output showing its installation path (usually /usr/local/Cellar/imagemagick@6/6.9.9-38) and full details about the keg-only restriction.

  2. Add the keg-only version to your system PATH
    This is the safest way to use imagemagick@6 without breaking other tools. Depending on your shell:

    • For Bash users:
      Open your ~/.bash_profile or ~/.bashrc file in a text editor, then add this line:
      export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
      
      Save the file, then apply the changes immediately:
      source ~/.bash_profile
      
    • For Zsh users:
      Open your ~/.zshrc file, add the same export PATH line above, then run:
      source ~/.zshrc
      
  3. Verify the fix works
    Test if your system can now find the imagemagick@6 commands by running:

    convert --version
    

    You should see output showing version 6.9.9-38 (or the specific version you installed) instead of an error.

If you absolutely need imagemagick@6 to be your default ImageMagick version (and don’t mind overriding the main imagemagick symlinks), you can run:

brew link imagemagick@6 --force

⚠️ Warning: This will replace symlinks for the default imagemagick formula, which might break tools that expect version 7.x. Use this only if you’re sure you don’t need the newer version.

内容的提问来源于stack exchange,提问作者user2012677

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:27:03