Homebrew安装使用卸载
1、安装
国外源脚本执行:
复制代码
1
2ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果执行中出现连接超时等问题,可以尝试执行下面的脚本。
执行安装命令,执行的脚步是国内的开源中国提供的源安装路径(https://gitee.com)
复制代码
1
2/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
执行之后需要选择下载源
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15开始执行Brew自动安装程序 [cunkai.wang@foxmail.com] ['2023-01-06 11:22:38']['13.0'] https://zhuanlan.zhihu.com/p/111014448 请选择一个下载brew本体的序号,例如中科大,输入1回车。 源有时候不稳定,如果git克隆报错重新运行脚本选择源。 1、中科大下载源 2、清华大学下载源 3、北京外国语大学下载源 4、腾讯下载源 5、阿里巴巴下载源 请输入序号: 1
输入下载源之后等待下载,等待可能会稍微长一些,耐心等待。
安装好之后执行一下brew -v,查看一下当前版本,我执行过之后出现如下情况:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13/opt brew -v Homebrew 3.6.17-57-gea0b786 fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core' To add an exception for this directory, call: git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core Homebrew/homebrew-core (no Git repository) fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask' To add an exception for this directory, call: git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask Homebrew/homebrew-cask (no Git repository)
上面有标识,需要执行git config --global,按照上面的提示执行一下相关的命令,如下:
复制代码
1
2
3git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
执行完成之后,在执行brew -v查看一下是否还会出现fatal信息:
复制代码
1
2
3
4Homebrew 3.6.17-57-gea0b786 Homebrew/homebrew-core (git revision 40f6cac1262; last commit 2023-01-06) Homebrew/homebrew-cask (git revision 3a51e6f790; last commit 2023-01-05)
2、使用
执行之后查看一下应该是没有问题的,现在安装一下软件看看homebrew是否安装成功brew install wget
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50/opt/homebrew (master ✔) brew install wget ==> Fetching dependencies for wget: gettext, libunistring, libidn2, ca-certificates and openssl@1.1 ==> Fetching gettext ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/gettext-0.21.1.arm64_ventura.bottle.tar.gz Already downloaded: /Users/halo/Library/Caches/Homebrew/downloads/1278013e6188ef044a9c3bb644acbb032a608bfe7583db091a8c15f0b5a42c63--gettext-0.21.1.arm64_ventura.bottle.tar.gz ==> Fetching libunistring ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libunistring-1.1.arm64_ventura.bottle.tar.gz Already downloaded: /Users/halo/Library/Caches/Homebrew/downloads/a8ac0bb0aac2c0e1e2c3413b71b5cd4ed92ce1c9959b8c302050239c30bab50f--libunistring-1.1.arm64_ventura.bottle.tar.gz ==> Fetching libidn2 ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libidn2-2.3.4_1.arm64_ventura.bottle.tar.gz Already downloaded: /Users/halo/Library/Caches/Homebrew/downloads/bff2bb496dedf7d291f5ff6a319d279524031fb35b397eb9bf827f639d47db06--libidn2-2.3.4_1.arm64_ventura.bottle.tar.gz ==> Fetching ca-certificates ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/ca-certificates-2022-10-11.all.bottle.tar.gz Already downloaded: /Users/halo/Library/Caches/Homebrew/downloads/10a0aa3f1cb1c4bdd31b95b30e6838414c313b5f40761671816349d96125a848--ca-certificates-2022-10-11.all.bottle.tar.gz ==> Fetching openssl@1.1 ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl%401.1-1.1.1s.arm64_ventura.bottle.tar.gz Already downloaded: /Users/halo/Library/Caches/Homebrew/downloads/1c71d0902e75b0c6a93a9aaa12b377db6239fdd53abed53db7304458bd7aa957--openssl@1.1-1.1.1s.arm64_ventura.bottle.tar.gz ==> Fetching wget ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/wget-1.21.3_1.arm64_ventura.bottle.tar.gz Already downloaded: /Users/halo/Library/Caches/Homebrew/downloads/0ec7f00c7477dd6cfb383eb095f7c73f945ca5a14874eec1a79f07f7a3bf92df--wget-1.21.3_1.arm64_ventura.bottle.tar.gz ==> Installing dependencies for wget: gettext, libunistring, libidn2, ca-certificates and openssl@1.1 ==> Installing wget dependency: gettext ==> Pouring gettext-0.21.1.arm64_ventura.bottle.tar.gz ???? /opt/homebrew/Cellar/gettext/0.21.1: 1,983 files, 20.9MB ==> Installing wget dependency: libunistring ==> Pouring libunistring-1.1.arm64_ventura.bottle.tar.gz ???? /opt/homebrew/Cellar/libunistring/1.1: 56 files, 5.0MB ==> Installing wget dependency: libidn2 ==> Pouring libidn2-2.3.4_1.arm64_ventura.bottle.tar.gz ???? /opt/homebrew/Cellar/libidn2/2.3.4_1: 79 files, 1MB ==> Installing wget dependency: ca-certificates ==> Pouring ca-certificates-2022-10-11.all.bottle.tar.gz ==> Regenerating CA certificate bundle from keychain, this may take a while... ???? /opt/homebrew/Cellar/ca-certificates/2022-10-11: 3 files, 225.4KB ==> Installing wget dependency: openssl@1.1 ==> Pouring openssl@1.1-1.1.1s.arm64_ventura.bottle.tar.gz ???? /opt/homebrew/Cellar/openssl@1.1/1.1.1s: 8,101 files, 18MB ==> Installing wget ==> Pouring wget-1.21.3_1.arm64_ventura.bottle.tar.gz ???? /opt/homebrew/Cellar/wget/1.21.3_1: 89 files, 4.2MB ==> Running `brew cleanup wget`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). /opt/homebrew (master ✔) wget wget: missing URL Usage: wget [OPTION]... [URL]... Try `wget --help' for more options.
安装wget之后,执行wget命令,显示wget: missing URL
,说明安装成功。
执行brew,可以查看brew的帮助文档,上面有些执行命令,如下:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49/opt/homebrew (master ✔) brew Example usage: 查询应用brew search [应用名] brew search TEXT|/REGEX/ 查看应用信息 brew info brew info [FORMULA|CASK...] 安装包 brew install FORMULA|CASK... 更新Homebrew brew update 更新包 brew upgrade [应用名] |如果不加包名就更新全部 brew upgrade [FORMULA|CASK...] 卸载包 brew uninstall [应用名] 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 不在brew帮助文档里面的命令: # 清理所有包的旧版本 brew cleanup # 清理指定包的旧版本 brew cleanup [应用名] # 查看可清理的旧版本包,不执行实际操作 brew cleanup -n # 查询可更新的包 brew outdated # 锁定某个包 brew pin [应用名] # 取消锁定 brew unpin [应用名] # 查看版本 brew -v
3、卸载
卸载Homebrew 脚本:
国内源卸载
复制代码
1
2/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"
国外源卸载
复制代码
1
2/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
最后
以上就是殷勤柠檬最近收集整理的关于Homebrew安装使用卸载Homebrew安装使用卸载的全部内容,更多相关Homebrew安装使用卸载Homebrew安装使用卸载内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复