【问题标题】:How can I tell whether I installed Homebrew correctly?如何判断我是否正确安装了 Homebrew?
【发布时间】:2023-04-06 15:50:01
【问题描述】:

不久前,我在我的 Mac 上安装了 Homebrew,我担心我做错了,这会导致 Brew 无法正常工作。是否可以从终端运行某种命令来检查一切是否正常?

我担心设置不正确有两个原因:

  1. 我正在观看this tutorial,他在其中运行命令brew search,它为他提供了可以安装的软件包列表。但是当我运行命令时,我收到错误消息This command requires at least 1 text or regex argument. 这是正常的吗?
  2. 当我运行 brew 命令时,它需要的时间比我从终端运行其他命令时长得多(可能是 3 秒)。这正常吗?

【问题讨论】:

    标签: macos homebrew


    【解决方案1】:

    brew --version 是检查软件是否安装成功的基本且最简单的方法。

    $ brew --version
    Homebrew 3.2.17-108-ge518ea4
    Homebrew/homebrew-core (git revision 4eaec4244d4; last commit 2021-10-21)
    Homebrew/homebrew-cask (git revision 4d10ee7007; last commit 2021-10-22)
    

    对于brew 命令,您可以运行帮助以了解可以尝试的更多选项,例如

    $ brew search --help
    Usage: brew search, -S [options] text|/regex/ [...]
    
    Perform a substring search of cask tokens and formula names for text. If
    text is flanked by slashes, it is interpreted as a regular expression. The
    search for text is extended online to homebrew/core and homebrew/cask.
    
          --formula, --formulae        Search online and locally for formulae.
          --cask, --casks              Search online and locally for casks.
          --desc                       Search for formulae with a description
                                       matching text and casks with a name
                                       matching text.
          --pull-request               Search for GitHub pull requests containing
                                       text.
          --open                       Search for only open GitHub pull requests.
          --closed                     Search for only closed GitHub pull
                                       requests.
          --repology                   Search for text in the given database.
          --macports                   Search for text in the given database.
          --fink                       Search for text in the given database.
          --opensuse                   Search for text in the given database.
          --fedora                     Search for text in the given database.
          --archlinux                  Search for text in the given database.
          --debian                     Search for text in the given database.
          --ubuntu                     Search for text in the given database.
      -d, --debug                      Display any debugging information.
      -q, --quiet                      Make some output more quiet.
      -v, --verbose                    Make some output more verbose.
      -h, --help                       Show this message.
    

    比如我要安装go,我可以做brew search go

    $ brew search node
    ==> Formulae
    heroku/brew/heroku-node ✔            node ✔                               node@10                              node_exporter                        nodenv
    libbitcoin-node                      node-build                           node@12                              nodebrew                             ode
    llnode                               node-sass                            node@14                              nodeenv
    ==> Casks
    font-ubuntu-mono-derivative-powerline                         nodebox                                                       nodeclipse
    nodebox                                                       nodeclipse
    
    If you meant "node" specifically:
    It was migrated from homebrew/cask to homebrew/core.
    

    【讨论】:

    • brew doctor 还可以很好地检查您的安装。
    猜你喜欢
    • 2012-07-09
    • 1970-01-01
    • 1970-01-01
    • 2013-10-26
    • 2013-07-21
    • 2013-12-23
    • 2010-09-16
    • 2012-06-25
    • 1970-01-01
    相关资源
    最近更新 更多