Mac下brew更换国内镜像源

使用清华镜像源

官方使用说明

在终端一次运行如下每一行代码

git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

brew update

在使用过最后brew update后,需要等待一部分时间,大概一分钟,如果看见终端上方一直在变化就离成功不远了,最后会在终端中显示更新信息,就算是大功告成了

复原

git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git

brew update

其他源可参考:

Homebrew更换国内镜像源(中科大、阿里、清华)_TyrantBoy的博客-CSDN博客_清华镜像源

Jenkins服务相关:

安装包安装的Jenkins
修改默认端口的方法:

  1. 先关闭jenkins ;
  2. 命令行下修改端口:sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 7071
  3. 启动jenkins: sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
  4. 停止jenkins:sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

用brew安装的的Jenkins
修改默认端口的方法:

  1. 打开文件 vi /usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist
  2. 修改默认端口号
  1. 启动jenkins: brew services start jenkins
  2. 停止jenkins:brew services stop jenkins
  3. 重启Jenkins:brew services restart jenkins
  4. 更新:切换到目录cd ~/.jenkins,然后用最新下载的war包替换文件夹中的war
  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值