当前位置:网站首页>homwbrew安装、常用命令以及安装路径
homwbrew安装、常用命令以及安装路径
2022-04-23 15:57:00 【aserendipper】
一、安装
1、homebrew是什么?
Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。
2、安装homebrew
homebrew官网中介绍安装homebrew只需一句脚本。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
通过终端输入此命令后,会出现连接拒绝。
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
解决办法一
- 修改hosts文件,添加以下内容到hosts中末尾。
sudo vi /etc/hosts
199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
- 重新输入安装脚本,泡一杯奶茶,静等下载(时间比较长)。
解决办法二
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
- 上面脚本中使用了中科大镜像来加速访问。
如果命令执行卡在下面信息:
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
Control + c中断脚本执行并运行以下命令:
cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git
成功执行之后继续执行安装命令:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
3、输入命令brew -v
验证是否安装成功。
二、常用命令
以下命令以对git操作为例
brew -v 查看homebrew安装版本
brew --help 简洁命令帮助
man brew 完整命令帮助
brew search git 搜索软件包
brew install git 安装软件包
brew uninstall git 卸载安装包
brew list 显示已安装的所有软件包
brew list git 查看安装软件包的安装地址
brew pin git 锁定不想更新的软件包
brew unpin git 取消锁定不想更新的软件包
brew outdated 查看已安装的哪些软件包需要更新以及更新情况
brew update 同步远程最新更新情况,对本机已经安装并有更新的软件用*标明
brew upgrade git 更新单个软件包
brew info git 查看软件包信息
brew home git 访问软件包的官方网站
brew cleanup -n 查看可清理的旧版本包,不执行实际操作
brew cleanup 清理所有已安装软件包的历史版本
brew cleanup git 清理单个已安装软件包的历史版本
三、homebrew安装路径
/usr/local/Cellar 所有homebrew安装的程序,都以[程序名/版本号]存放于本目录下
/usr/local/bin 用于存放所有安装程序的启动链接(相当于快捷方式)
/usr/local/etc 安装程序的配置文件默认存放路径
/usr/local/opt homebrew下载软件包存放路径
/usr/local/Homebrew homebrew自身存放文件夹
版权声明
本文为[aserendipper]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_39234967/article/details/117674967
边栏推荐
猜你喜欢
随机推荐
IronPDF for . NET 2022.4.5455
一文读懂串口及各种电平信号含义
【开源工具分享】单片机调试助手(示波/改值/日志) - LinkScope
Application of Bloom filter in 100 million flow e-commerce system
C语言自编字符串处理函数——字符串分割、字符串填充等
leetcode-374 猜数字大小
Algorithem_ ReverseLinkedList
Website pressure measurement tools Apache AB, webbench, Apache jemeter
[AI weekly] NVIDIA designs chips with AI; The imperfect transformer needs to overcome the theoretical defect of self attention
JS regular détermine si le nom de domaine ou le chemin de port IP est correct
VIM specifies the line comment and reconciliation comment
多级缓存使用
Upgrade MySQL 5.1 to 5.67
Temporal model: long-term and short-term memory network (LSTM)
PS为图片添加纹理
WPS brand was upgraded to focus on China. The other two domestic software were banned from going abroad with a low profile
为啥禁用外键约束
PS add texture to picture
Spark 算子之coalesce与repartition
Use bitnami PostgreSQL docker image to quickly set up stream replication clusters