美文网首页
国内ali源设置集合

国内ali源设置集合

作者: _孙行者_ | 来源:发表于2022-01-21 15:41 被阅读0次

阿里镜像站

https://developer.aliyun.com/mirror/

软件下载

DNS

  • 223.5.5.5
  • 223.6.6.6
  • 2400:3200::1
  • 2400:3200:baba::1

Liunx 配置

  • ipv4
# 编辑 /etc/resolv.conf
nameserver 223.5.5.5
nameserver 223.6.6.6

  • ipv6
# 编辑 sudo vim /etc/resolv.conf
nameserver 2400:3200::1
nameserver 2400:3200:baba::1

保存退出,然后使用 dig 验证:

dig alidns.com

npm 设置ali 源:

参考: http://www.npmmirror.com/

npm config set registry https://registry.npm.taobao.org
# 查看
npm config get registry

yarn 设置 ali 源:

yarn config set registry https://registry.npm.taobao.org/
# 查看
yarn config get registry

pip 设置ali源:

参考: https://developer.aliyun.com/mirror/pypi

临时修改

pip install scrapy -i http://mirrors.aliyun.com/pypi/simple

永久修改

Linux , 修改pip.conf , 文件,没有就创建一个 .

$HOME/.config/pip/pip.conf

# 修改如下:
[global]

index-url = http://mirrors.aliyun.com/pypi/simple

Windows , 修改 pip.ini文件 (没有就创建一个)

%APPDATA%\pip\pip.ini

#修改为如下:
[global]

index-url = http://mirrors.aliyun.com/pypi/simple

Ubuntu 设置 ali源 :

参考: https://developer.aliyun.com/mirror/ubuntu

  • 备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 
  • 修改
sudo vim /etc/apt/sources.list

修改为如下内容:

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

Maven , Gradle 仓库

参考: https://developer.aliyun.com/mirror/maven

settings.xml中使用

<mirror>
    <id>aliyunmaven</id>
    <mirrorOf>*</mirrorOf>
    <name>阿里云公共仓库</name>
    <url>https://maven.aliyun.com/repository/public</url>
</mirror>

Homebrew 仓库

参考: https://developer.aliyun.com/mirror/homebrew

  • Bash 终端配置
    # 替换brew.git:
    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
    # 替换homebrew-core.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
    # 应用生效
    brew update
    # 替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile
  • Zsh终端
    # 替换brew.git:
    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
    # 替换homebrew-core.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
    # 应用生效
    brew update
    # 替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc

Docker

参考: https://developer.aliyun.com/mirror/docker-ce

  • Ubuntu 14.04/16.04(使用 apt-get 进行安装)
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce

# 安装指定版本的Docker-CE:
# Step 1: 查找Docker-CE的版本:
# apt-cache madison docker-ce
#   docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
#   docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# Step 2: 安装指定版本的Docker-CE: (VERSION例如上面的17.03.1~ce-0~ubuntu-xenial)
# sudo apt-get -y install docker-ce=[VERSION]

相关文章

  • 国内ali源设置集合

    阿里镜像站 https://developer.aliyun.com/mirror/[https://develo...

  • Composer国内镜像源设置姿势

    安装composer 设置国内镜像源姿势一 之 全局配置 设置国内镜像源姿势之一 之 单项目配置 设置国内镜像源姿...

  • pip install 代理源设置

    更改pip install的代理源,提高下载速度。国内的一些代理源:阿里云 :http://mirrors.ali...

  • elementary os 使用阿里源

    ali源

  • npm、nvm 相关命令

    1.npm查看当前源,以及设置为国内源 查看当前源:npm config get registry 设置为国内源:...

  • Manjaro折腾记录

    系统配置 1. 设置官方镜像源 设置国内下载节点 更新数据源 2. 添加ArchLinux(国内)镜像库 打开配置...

  • 修改为国内yum源

    国外地址yum源下载慢,下到一半就断了,就这个原因就修改它为国内yum源地址,国内也就是ali 与 网易。以cen...

  • Docker学习一

    Docker国内镜像源设置 DaoCloud(https://www.daocloud.io/)可以设置 Cent...

  • docker 设置国内镜像源

    创建或修改 /etc/docker/daemon.json 文件,修改为如下形式 # vi /etc/docker...

  • npm镜像源

    npm镜像源 1、国内用户,建议将npm的注册表源设置为国内的镜像,可以大幅提升安装速度,先查看本机地址 2、国内...

网友评论

      本文标题:国内ali源设置集合

      本文链接:https://www.haomeiwen.com/subject/vfbehrtx.html