本项目灵感来自:package-manager-proxy-settings,该项目分享的是包管理器配置代理的方法,这里分享的是包管理器直接可用,质量好,速度快的镜像,以及一些其他常用软件,系统镜像的国内镜像。
在此,对那些提供公共仓库镜像的企业或组织,致以感谢🫡!
Gitee:https://gitee.com/eryajf/Thanks-Mirror
目录
以往工作中经历过建设企业内部私服的经历,私服的建设离不开国内一些优秀的镜像代理,这里记录下来,以供大家参考。
注意:
假如所有的镜像都已经被本地nexus私服代理,那么对应的地址为nexus.eryajf.net/repository/***/
。(这只是个域名示例,不代表实际可用!)
如果go版本用的go1.11
或者go1.12
,需进行如下配置:
export GO111MODULE=on
export GOPROXY="http://nexus.eryajf.net/repository/go/"
如果使用 go1.13
以上的版本则可以用如下配置:
export GOPROXY="http://nexus.eryajf.net/repository/go/"
GONOPROXY="gitlab.eryajf.net"
GONOSUMDB="gitlab.eryajf.net"
GOPRIVATE="gitlab.eryajf.net"
GOSUMDB="sum.golang.google.cn"
关于如上两个版本配置差异,以及配置参数详解可参考:https://wiki.eryajf.net/pages/4941.html
- Aliyun
- Proxy-cn
- Proxy-io
- Baidu
- Tencent
- HUAWEI
其中GOSUMDB
在国内可用的两个镜像分别如下:
- sumdb-io
配置npm
代理,需进行如下配置:
# npm配置
$ echo 'registry=http://nexus.eryajf.net/repository/npm' > ~/.npmrc
# 查看
$ npm config get registry
http://nexus.eryajf.net/repository/npm
# yarn配置
$ echo 'registry "http://nexus.eryajf.net/repository/npm"' > ~/.yarnrc
# 查看
$ yarn config get registry
http://nexus.eryajf.net/repository/npm
-
Taobao
-
https://registry.npm.taobao.org
但是请注意如下一个消息:
- 淘宝 npm 域名即将切换 && npmmirror 重构升级:即原来的淘宝npm域名将停止解析,因此所有依赖此域名的都需要进行更改。
-
-
HUAWEI
-
浙江大学
-
南京邮电
-
npmjs
配置Python
代理,需进行如下配置:
$ mkdir ~/.pip
$ cat > ~/.pip/pip.conf << EOF
[global]
timeout = 60
trusted-host = nexus.eryajf.net
index-url = http://nexus.eryajf.net/repository/pypi/simple
EOF
注意:
通常在配置文件后边,我们会添加一个simple
。
目前代理外部私仓有:
-
Aliyun
-
douban
-
清华
-
163
-
HUAWEI
-
Tencent
-
北大
-
南阳理工
-
大连东软
Java系的工具版本规范如下:
JDK:
1.8.0_292MVN:
3.3.9
配置Maven代理,需进行如下配置:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>~/.m2/repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>releases</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>snapshots</id>
<username>username</username>
<password>password</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus-eryajf</id>
<mirrorOf>*</mirrorOf>
<name>Nexus osc</name>
<url>http://nexus.eryajf.net/repository/maven/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>developer</id>
<activation>
<jdk>jdk-1.8</jdk>
</activation>
<repositories>
<repository>
<id>nexus-eryajf-local</id>
<name>local private nexus</name>
<url>http://nexus.eryajf.net/repository/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-eryajf</id>
<name>local private nexus</name>
<url>http://nexus.eryajf.net/repository/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>developer</activeProfile>
</activeProfiles>
</settings>
-
HUAWEI
-
Maven Central Repository
-
Tencent
-
南京邮电
-
Apache Maven
-
confluent
-
cloudera
-
jboss
如果CentOS
服务器要接入私服yum
源,则清空本地 /etc/yum.repos.d
的内容,添加如下内容:
$ cat >> /etc/yum.repos.d/nexus.repo << 'EOF'
[nexus]
name=Nexus Repository
baseurl=http://nexus.eryajf.net/repository/yum/$releasever/os/$basearch/
enabled=1
gpgcheck=0
[nexus-local]
name=Nexus Repository
baseurl=http://nexus.eryajf.net/repository/eryajf-yum-local/
enabled=1
gpgcheck=0
EOF
然后执行如下命令:
yum clean all
yum makecache
目前代理外部源:
- Aliyun
- HUAWEI
- Tencent
- 北京交通
- 东北大学
- 兰州大学
- 清华
- 华中科技大学
- 浙江大学
- souhu
- 163:
如果你使用了zsh,那么配置方式如下:
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"' >> ~/.zshrc
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"' >> ~/.zshrc
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"' >> ~/.zshrc
source ~/.zshrc
brew update
- Aliyun
- Tencent
- 清华:
还有一些软件,直接通过官方下载比较困难,也整理出方便下载的国内优质镜像。
-
Aliyun
-
Tencent
-
HUAWEI
-
北大
-
清华
-
中科大
-
西北农林科技大学
-
浙江大学
- Aliyun
- Tencent
- HUAWEI
- 北大
- 清华
- 中科大
-
Aliyun
-
Tencent
-
HUAWEI
-
中科大
-
清华
-
elastic中文社区
-
Aliyun
-
HUAWEI
-
Tencent
-
清华
-
南京邮电
- elastic中文社区
- HUAWEI
- elastic中文社区
- HUAWEI
- elastic中文社区
- HUAWEI
- Aliyun
- HUAWEI
- Tencent
- Souhu
- 清华
- 中科大
- 南阳理工
- Aliyun
- Tencent
- HUAWEI
- 清华
- 中科大
- Aliyun
- Tencent
- 163
- 清华
-
Aliyun
-
Tencen
-
HUAWEI
-
清华
-
中科大
-
浙江大学
-
南阳理工
- Go语言中文网
- Aliyun
- Proxy-io
- 中科大
- Aliyun
- HUAWEI
- Tencent
- 清华
- 中科大
- HUAWEI
- 北京交通
- 中科大
- Aliyun
- HUAWEI
- Tencent
- 清华
- 南京邮电
- 西北农林科技大学
- 南阳理工
- Aliyun
- HUAWEI
- Tencent
- 清华
- 西北农林科技大学
-
Aliyun
-
HUAWEI
-
Tencent
-
Souhu
-
北大
-
清华
-
中科大
-
北京交通
- HUAWEI
- Souhu
- 中科大
- 西北农林科技大学
系统镜像,又大又远,更需要找到好用优秀的国内镜像。
尽管CentOS不再更新了,但它仍旧并且还将持续是国内企业系统主力军。
可能官方考虑到下载困难的问题,官方也列出了距离使用者更近的镜像列表,可谓贴心。
- Aliyun
- Tencent
- HUAWEI
- 163
- Souhu
- 北大
- 清华
- 中科大
- 浙江大学
- 兰州大学
- 东北大学
- 大连东软
- 上海交通
- 北京交通
- 大连理工
- 首都在线
- 南京邮电
- 西北农林科技大学