1.docker国内源
linux
编辑文件/etc/docker/daemon.json,没有创建
{ "registry-mirrors":[ "http://docker.mirrors.ustc.edu.cn", "http://hub-mirror.c.163.com", "http://registry.docker-cn.com" ] , "insecure-registries":[ "docker.mirrors.ustc.edu.cn", "registry.docker-cn.com" ] }
2.pip国内源
pip安装:
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py -o get-pip.py curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py
方法一:linux 编辑文件~/.pip/pip.conf
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=mirrors.aliyun.com
方法二:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple pip config set install.trusted-host mirrors.aliyun.com
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
3. npm源
国内优秀npm镜像
淘宝npm镜像
搜索地址:http://npm.taobao.org/
registry地址:http://registry.npm.taobao.org/
cnpmjs镜像
搜索地址:http://cnpmjs.org/
registry地址:http://r.cnpmjs.org/
npm config set registry https://registry.npm.taobao.org
4.系统源
centos
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo yum makecache
ubuntu
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
alpine
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
5.go语言
go env -w GO111MODULE=on # 七流云代理 go env -w GOPROXY=https://goproxy.cn,direct # 阿里云代理 go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/ # 官方代理 go env -w GOPROXY=https://goproxy.io,direct
6.compposer
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
7.maven
<mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror>
8.rubgems
# 查找默认源 gem sources # 移除默认源 gem sources --remove https://rubygems.org/ # 添加新源 gem sources -a https://mirrors.aliyun.com/rubygems/
9.Kubernetes
ubuntu
apt-get update && apt-get install -y apt-transport-https curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add - cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main EOF apt-get update apt-get install -y kubelet kubeadm kubectl
centos
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/ enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF setenforce 0 yum install -y kubelet kubeadm kubectl systemctl enable kubelet && systemctl start kubelet
10. java环境变量配置
在/etc/profile添加
export JAVA_HOME=/usr/share/jdk1.8.0 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
11.maven环境变量配置
在/etc/profile添加
export MAVEN_HOME=/usr/local/maven/apache-maven-3.5.2 export PATH=$MAVEN_HOME/bin:$PATH
最新评论