# Anaconda
1.1 Anaconda
1、地址
http://mirrors.cmrh.com/anaconda
2、说明
Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。
Anaconda 安装包可以到 http://mirrors.cmrh.com/anaconda/archive/ 下载。
招商金科开源镜像站还提供了 Anaconda 仓库的镜像,运行以下命令:
conda config --add channels http://mirrors.cmrh.com/anaconda/pkgs/free/
conda config --add channels http://mirrors.cmrh.com/anaconda/pkgs/main/
conda config --set show_channel_urls yes
即可添加 Anaconda Python 免费仓库。
# CentOS
1.2 CentOS
1、地址
http://mirrors.cmrh.com/centos
2、说明
CentOS官方软件源
3、自动配置
执行如下命令自动配置,并备份当前配置
curl -s http://mirrors.cmrh.com/s/config/yum | bash
3、手动配置
•备份CentOS*-Base.repo文件;
mv /etc/yum.repos.d/CentOS*-Base.repo /tmp/CentOS-Base.repo.bak
•根据系统版本写入新的内容到配置文件/etc/yum.repos.d/CentOS-Base.repo;
•更新yum缓存;
yum clean all && yum makecache
CentOS 7
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.cmrh.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?
release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.cmrh.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?
release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.cmrh.com/centos/$releasever/extras/$basearch/
pgcheck=1
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?
release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.cmrh.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-7
CentOS 6
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.cmrh.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?
release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.cmrh.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?
release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.cmrh.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?
release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.cmrh.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.cmrh.com/centos/RPM-GPG-KEY-CentOS-6
# EPEL
1.3 EPEL
1、地址
2、说明
EPEL(Extra Packages for Enterprise Linux)是由Fedora Special Interest Group维护的Enterprise Linux(RHEL、CentOS)中经 常用到的包。
3、自动配置
执行如下命令自动配置,并备份当前配置
curl -s http://mirrors.cmrh.com/s/config/yum | bash
3、手动配置
•备份已有配置(没有也无妨);
mv /etc/yum.repos.d/epel* /tmp/
•写入新配置;
根据系统版本写入相应的配置到文件/etc/yum.repos.d/epel.repo
•更新yum缓存;
yum clean all && yum makecache
CentOS7, OracleLinux7, RHEL7
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.cmrh.com/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?
repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/epel/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.cmrh.com/epel/7/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://mirrors.cmrh.com/epel/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.cmrh.com/epel/7/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://mirrors.cmrh.com/epel/RPM-GPG-KEY-EPEL-7
gpgcheck=1
CentOS6, OracleLinux6, RHEL6
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.cmrh.com/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://mirrors.cmrh.com/epel/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://mirrors.cmrh.com/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://mirrors.cmrh.com/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://mirrors.cmrh.com/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://mirrors.cmrh.com/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1
# PyPI
1.4 PyPI
1、地址
2、说明
Python (pip) 软件源
3、配置
编辑pip配置文件,将index-url
修改为http://mirrors.cmrh.com/pypi/web/simple
pip 的配置文件一般位于(如果没有就新建一个):
Unix/Linux 环境: $HOME/.config/pip/pip.conf
macOS: $HOME/Library/Application Support/pip/pip.conf
Windows: %APPDATA%pippip.ini
pip.conf文件内容如下:
[global]
index-url = http://mirrors.cmrh.com/pypi/web/simple
trusted-host = mirrors.cmrh.com
# Ubuntu
1.5 Ubuntu
1、地址
http://mirrors.cmrh.com/ubuntu
2、说明
Ubuntu镜像源,包含官方当前支持的所有版本,具体版本见https://wiki.ubuntu.com/Releases
3、自动配置
执行如下命令自动配置,并备份当前配置
curl -s http://mirrors.cmrh.com/s/config/apt | bash
3、手动配置
•备份已有配置;
mv /etc/apt/sources.list /etc/apt/sources.list.bak
•写入新的配置;
根据Ubuntu版本,写入相应的配置到/etc/apt/sources.list
•更新apt缓存;
apt-get update
# NPM
1.6 NPM
1、地址
2、说明
该镜像同步自互联网
3、配置
启用招商金科npm registry:
npm set registry http://npm.cmrh.com
恢复原始registry:
npm config delete registry http://npm.cmrh.com/
查看当前registry:
npm config get registry
4、私有包管理
只有通过注册并且属于管理员组的用户才有权限上传私有包.
注册用户: npm adduser --registry http://npm.cmrh.com
登录用户: npm login
发布私有包: npm publish <package name> --registry http://npm.cmrh.com
撤销私有包: npm unpublish <package name> --registry http://npm.cmrh.com
注:注册和上传私有包请联系彭坤 pengk@cmrh.com
# TensorFlow
1.7 TensorFlow
1、地址
http://mirrors.cmrh.com/tensorflow
2、说明
请先安装 python 环境,科学计算用途建议安装 anaconda。
TensorFlow 安装方法请参考 https://www.tensorflow.org/get_started
把 https://storage.googleapis.com/ 替换为 http://mirrors.cmrh.com/ 即可。
# RubyGems
1.8 RubyGems
1、地址
http://mirrors.cmrh.com/rubygems
2、说明
gem
使用以下命令替换 gems 默认源
•添加招商金科源并移除默认源
gem sources --add http://mirrors.cmrh.com/rubygems/ --remove https://rubygems.org/
•列出已有源
gem sources -l
•应该只有 cmrh 一个,或者,编辑 ~/.gemrc,将 http://mirrors.cmrh.com/rubygems/ 加到 sources 字段。
bundler
使用以下命令替换 bundler 默认源
bash bundle config mirror.https://rubygems.org http://mirrors.cmrh.com/rubygems
官方文档: http://bundler.io/v1.16/man/bundle-config.1.html#MIRRORS-OF-GEM-SOURCES