常用源

ubuntu16.04 APT源:

cp /etc/apt/sources.list /etc/apt/sources.list.orgin && \
echo "\
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe">/etc/apt/sources.list

 pip源:

mkdir $HOME/.pip && \
echo "\
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com">$HOME/.pip/pip.conf

npm源:

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

docker源:

echo "\
{
  \"registry-mirrors\": [
    \"https://kfwkfulq.mirror.aliyuncs.com\",
    \"https://2lqq34jg.mirror.aliyuncs.com\",
    \"https://pee6w651.mirror.aliyuncs.com\",
    \"https://registry.docker-cn.com\",
    \"http://hub-mirror.c.163.com\"
  ],
  \"dns\": [
    \"8.8.8.8\",
    \"8.8.4.4\"
  ]
}

maven源:

cp /etc/maven/settings.xml /etc/maven/settings.xml.orgin && \
echo "<?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\">
    <mirrors>
        <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>
    
        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
    
        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
    </mirrors> 
</settings>

猜你喜欢

转载自www.cnblogs.com/steinven/p/12018299.html