awesome-env-config-cn
各種開發(fā)語(yǔ)言項(xiàng)目環(huán)境國(guó)內(nèi)(中國(guó)國(guó)內(nèi)加速鏡像)配置教程和部分實(shí)踐經(jīng)驗(yàn),包括github.com, nodejs礼仗,npm吐咳,nvm, yarn, java, maven, gradle, python, mysys2, elasticsearch, php等等,更多正在加入中
源碼地址:https://github.com/yunchaoq/awesome-env-config-cn
TODO 待補(bǔ)充的
歡迎大家一起補(bǔ)充
- ruby
- pod
- ...
目錄
linux
- 推薦使用阿里云鏡像https://developer.aliyun.com/mirror/ 包括了各種鏡像
github
-
推薦使用chrome插件 https://github.com/jadezi/github-accelerator/ 訪問github對(duì)應(yīng)的網(wǎng)站自動(dòng)展示加速連接
- 國(guó)內(nèi)鏡像源1象浑,推薦:https://hub.fastgit.org
- 國(guó)內(nèi)鏡像源2:https://github.com.cnpmjs.org 這個(gè)沒有上面的快點(diǎn)
nodejs
-
nodejs 安裝
-
直接下載安裝(推薦使用nvm管理nodejs版本自由切換):
- 下載地址: http://npm.taobao.org/mirrors/node 選擇對(duì)應(yīng)的版本下載安裝即可
-
nvm
-
linux或者mac
鏡像源:https://hub.fastgit.org/nvm-sh/nvm
官方地址:https://github.com/nvm-sh/nvm
- 安裝
- linux或者mac安裝,鏡像:
curl -o- https://raw.fastgit.org/nvm-sh/nvm/master/install.sh | bash 或者 wget -qO- https://raw.fastgit.org/nvm-sh/nvm/master/install.sh | bash
- linux或者mac安裝融柬,官方:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 或者 wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- linux或者mac安裝,鏡像:
- 配置國(guó)內(nèi)源
- 設(shè)置環(huán)境變量:NVM_NODEJS_ORG_MIRROR死嗦,bash編輯/.bashrc,zsh編輯/.zshrc
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
- 安裝
-
windows
鏡像源:https://hub.fastgit.org/coreybutler/nvm-windows
官方推薦地址:https://github.com/coreybutler/nvm-windows
-
安裝
-
配置國(guó)內(nèi)源
- 設(shè)置
nvm node_mirror http://npm.taobao.org/mirrors/node nvm npm_mirror https://npm.taobao.org/mirrors/npm/
-
yarn
-
yarn 安裝
- 需要首先安裝nodejs
- 然后使用npm安裝yarn或者更新
npm i -g yarn 或者 npm install -g yarn
-
配置國(guó)內(nèi)源
yarn config set registry https://registry.npm.taobao.org
npm
- npm 默認(rèn)安裝nodejs后就已經(jīng)有了粒氧,使用以下命令查看
npm -v
- npm更新越除,一下不適用于nvm安裝的node
npm i -g npm
- 配置國(guó)內(nèi)源,最簡(jiǎn)單的一種方式外盯,自動(dòng)配置淘寶源中多個(gè)配置
npm install -g mirror-config-china
jdk
- java jdk 安裝
- 配置現(xiàn)在一般都不需要配置
maven
-
maven安裝,apache比較良心箱熬,下載相關(guān)的基本都自帶鏡像 http://maven.apache.org/download.cgi
-
配置國(guó)內(nèi)源
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>https://maven.aliyun.com/repository/public</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>jcenter</id> <name>jcenter</name> <url>https://maven.aliyun.com/repository/central</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>google</id> <name>google</name> <url>https://maven.aliyun.com/repository/google</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>spring</id> <name>aliyun maven spring</name> <url>https://maven.aliyun.com/repository/spring</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>spring-plugin</id> <name>aliyun maven spring-plugin</name> <url>https://maven.aliyun.com/repository/spring-plugin</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>gradle-plugin</id> <name>aliyun maven gradle-plugin</name> <url>https://maven.aliyun.com/repository/gradle-plugin</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>grails-core</id> <name>aliyun maven grails-core</name> <url>https://maven.aliyun.com/repository/grails-core</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>apache snapshots</id> <name>aliyun maven apache snapshots</name> <url>https://maven.aliyun.com/repository/apache-snapshots</url> <mirrorOf>central</mirrorOf> </mirror>
gradle
-
gradle 安裝
- 鏡像,目前沒有查詢到國(guó)內(nèi)下載gradle鏡像的地址蚤认,大家知道的歡迎提供
- 官網(wǎng) https://services.gradle.org/distributions/
-
gradle 配置
終極配置米苹,在用戶目錄下~/.gradle/目錄下增加init.gradle文件,內(nèi)容如下
allprojects { buildscript { repositories { mavenLocal() def NEXUS_URL = 'https://maven.aliyun.com/repository/public' def jcenter_URL = 'https://maven.aliyun.com/repository/jcenter' def m2_URL = 'https://maven.aliyun.com/repository/gradle-plugin' def spring_plugin_URL = 'https://maven.aliyun.com/repository/spring-plugin' def spring_URL = 'https://maven.aliyun.com/repository/spring' def GOOGLE_URL = 'https://maven.aliyun.com/repository/google' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com') || url.startsWith('http://mirrors.ibiblio.org')) { project.logger.lifecycle "Repository ${repo.url} replaced by $jcenter_URL." remove repo } else if (url.startsWith('https://plugins.gradle.org/m2/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $m2_URL." remove repo } else if (url.startsWith('http://repo.spring.io/libs-milestone/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $spring_URL." remove repo } else if (url.startsWith('http://repo.spring.io/plugins-release/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $spring_plugin_URL." remove repo // 這里是安卓相關(guān)下載的加速砰琢,本地沒有出現(xiàn)下載慢的情況蘸嘶,所以這個(gè)就屏蔽了 //}else if (url.startsWith('https://dl.google.com/dl/android/maven2/')) { // project.logger.lifecycle "Repository ${repo.url} replaced by $GOOGLE_URL." // println("buildscript ${repo.url} replaced by $GOOGLE_URL.") // remove repo } } } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/spring' } maven { url 'https://maven.aliyun.com/repository/spring-plugin' } maven { url "https://maven.aliyun.com/repository/grails-core" } maven { url "https://maven.aliyun.com/repository/apache-snapshots" } maven { url "https://maven.aliyun.com/repository/gradle-plugin" } maven { url 'https://maven.aliyun.com/repository/google' } jcenter { url jcenter_URL } maven { url NEXUS_URL } } } repositories { mavenLocal() def NEXUS_URL = 'https://maven.aliyun.com/repository/public' def jcenter_URL = 'https://maven.aliyun.com/repository/jcenter' def m2_URL = 'https://maven.aliyun.com/repository/gradle-plugin' def spring_plugin_URL = 'https://maven.aliyun.com/repository/spring-plugin' def spring_URL = 'https://maven.aliyun.com/repository/spring' def GOOGLE_URL = 'https://maven.aliyun.com/repository/google' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com') || url.startsWith('http://mirrors.ibiblio.org')) { project.logger.lifecycle "Repository ${repo.url} replaced by $jcenter_URL." remove repo } else if (url.startsWith('https://plugins.gradle.org/m2/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $m2_URL." remove repo } else if (url.startsWith('http://repo.spring.io/libs-milestone/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $spring_URL." remove repo } else if (url.startsWith('http://repo.spring.io/plugins-release/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $spring_plugin_URL." remove repo // 這里是安卓相關(guān)下載的加速,本地沒有出現(xiàn)下載慢的情況陪汽,所以這個(gè)就屏蔽了 //}else if (url.startsWith('https://dl.google.com/dl/android/maven2/')) { // project.logger.lifecycle "Repository ${repo.url} replaced by $GOOGLE_URL." // println("buildscript ${repo.url} replaced by $GOOGLE_URL.") // remove repo } } } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/spring' } maven { url 'https://maven.aliyun.com/repository/spring-plugin' } maven { url "https://maven.aliyun.com/repository/grails-core" } maven { url "https://maven.aliyun.com/repository/apache-snapshots" } maven { url "https://maven.aliyun.com/repository/gradle-plugin" } maven { url 'https://maven.aliyun.com/repository/google' } jcenter { url jcenter_URL } maven { url NEXUS_URL } } }
python
- python 安裝
- windows 系統(tǒng)安裝训唱,直接下載安裝包
- linux 系統(tǒng)默認(rèn)自帶python况增,需要單獨(dú)安裝新版本,linux系統(tǒng)鏡像配置請(qǐng)參考linux系統(tǒng)鏡像源
- ubuntu
sudo apt-get update sudo apt-cache search python3* sudo apt-get install python3.8 # python3.5 python3.6 python3.7 等你辣,python3.8是當(dāng)前書寫的時(shí)候最新穩(wěn)定版本
- centos
sudo yum install epel-release -y sudo yum -y update sudo yum list python3* # 使用此命令查看當(dāng)前支持的python3版本 sudo yum install python37 # python35 python36 python37 等巡通,python38是當(dāng)前書寫的時(shí)候最新穩(wěn)定版本
pip
- pip 安裝 python 安裝成功后尘执,默認(rèn)自帶pip
-
阿里云鏡像說(shuō)明舍哄,https://developer.aliyun.com/mirror/pypi
- windows 下配置
mkdir %USERPROFILE%\.pip\ start %USERPROFILE%\.pip\
- 在這個(gè)目錄下創(chuàng)建pip.conf文件(推薦使用notepad++)
寫入內(nèi)容如下:
[global] index-url = https://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com
- 在這個(gè)目錄下創(chuàng)建pip.conf文件(推薦使用notepad++)
- linux
寫入內(nèi)容如下:mkdir -p ~/.pip # ubuntu 桌面下可以使用 gedit ~/.pip/pip.conf # vi 入門可以參考 https://github.com/wsdjeg/vim-galore-zh_cn vi ~/.pip/pip.conf
[global] index-url = https://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com
- windows 下配置
miniAnaconda
- (一般使用miniAnaconda,anaconda占用空間大誊锭,土豪可以直接忽略)清華鏡像源表悬,這里包括了anaconda的安裝配置說(shuō)明,https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
- 安裝 https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/ 下載對(duì)應(yīng)的文件執(zhí)行
- windows安裝
下載最新的exe文件安裝 - linux安裝
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.8.3-Linux-x86_64.sh sh Miniconda3-py38_4.8.3-Linux-x86_64.sh.sh
- windows安裝
- 配置鏡像
- windows 下配置
conda config --set show_channel_urls yes start %USERPROFILE%\
- 在這個(gè)目錄下編輯.condarc文件(推薦使用notepad++編輯丧靡,如果看不到這個(gè)文件蟆沫,請(qǐng)打開windows系統(tǒng)的隱藏文件選項(xiàng))
寫入內(nèi)容如下:
channels: - defaults show_channel_urls: true channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- 在這個(gè)目錄下編輯.condarc文件(推薦使用notepad++編輯丧靡,如果看不到這個(gè)文件蟆沫,請(qǐng)打開windows系統(tǒng)的隱藏文件選項(xiàng))
- linux
寫入內(nèi)容如下:conda config --set show_channel_urls yes # ubuntu 桌面下可以使用 gedit ~/.condarc # vi 入門可以參考 https://github.com/wsdjeg/vim-galore-zh_cn vi ~/.condarc
channels: - defaults show_channel_urls: true channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- windows 下配置
elasticsearch
- elasticsearch 安裝
kibana
- kibana (elasticsearch管理工具) 安裝饭庞,需要下載與elasticsearch版本一致
php
composer
- 安裝和配置參考累盗,https://pkg.phpcomposer.com/#how-to-install-composer
- 國(guó)內(nèi)鏡像用法參考,https://pkg.phpcomposer.com/#how-to-use-packagist-mirror
msys2
msys2-qt5
- msys2 安裝,清華鏡像拆融,https://mirror.tuna.tsinghua.edu.cn/help/msys2/
- 配置鏡像源
- 修改C:\msys64\etc\pacman.d(默認(rèn)安裝在c盤下面)下面得mirrorlist.*文件蠢琳,把清華鏡像相關(guān)得移動(dòng)到最前面
- 安裝
# 更新系統(tǒng)包 pacman -Syu # 基礎(chǔ)包 pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake bash wget p7zip pacman pacman-mirrors msys2-runtime # qt5 pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-qt5 mingw-w64-x86_64-qt-creator