常用工具的国内镜像源

伟大的天朝大国,使用一些国外的开发工具,总是异常的慢,解决问题的关键就是更换工具的源,换成国内的就爽了,收集了一些常用的工具国内源,方便以后使用。

更换 Homebrew 源

Homebrew 主要分两部分:git repo(位于 GitHub)和二进制 bottles(位于 Binary),这两者在国内访问不太顺畅。替换成国内的镜像,git repo国内镜像就比较多了,可以自行查找,如:阿里云…

1
2
3
4
5
$ 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

更换 Homebrew Bottles 源

使用 bash 的替换方法:

1
2
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

使用 zsh 的替换方法:

1
2
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

更换 nvm 源

使用 bash 的替换方法:

1
2
$ echo 'export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node' >> ~/.bash_profile
$ source ~/.bash_profile

使用 zsh 的替换方法:

1
2
$ echo 'export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node' >> ~/.zshrc
$ source ~/.zshrc

更换 npm 和 yarn 源

1
2
3
$ npm config set registry https://registry.npm.taobao.org

$ yarn config set registry https://registry.npm.taobao.org

更换 PyPI 源

1
2
$ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
$ pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

更换 Debain 源

修改 /etc/apt/sources.list 文件内容:

1
2
3
4
5
6
7
8
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

更换 Raspbian 源

修改 /etc/apt/sources.list 文件内容:

1
2
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
#deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib

修改 /etc/apt/sources.list.d/raspi.list 文件内容:

1
2
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
#deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

通过 U 盘安装 macOS Catalina Scratch 3.0 发布了
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×