系統
Ubuntu
阿里云,163均可,我用了阿里的鏡像。備份/et/apt/sources.list
文件,然后用下面的內容替換
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
其中,trusty
是14.04的代號,如果是16.04就改成xenial
,18.04就改為bionic
,以此類推。盡量使用LTS版本的Ubuntu,對各種第三方硬件支持比較完善。另外,對于開發環境來說,穩定壓倒一切,沒事不要亂升級。
軟件
Python
easy_install:
創建配置文件 $HOME/.pydistutils.cfg
,內容為
[easy_install]
index-url=http://pypi.douban.com/simple
find-links=
http://pypi.douban.com/simple
http://pypi.v2ex.com/simple
這里用的是豆瓣的源。
pip
又一次用了阿里的源。創建配置文件 $HOME/.pip/pip.conf
,內容為
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
Docker
采用Docker中國官方鏡像。可以在執行命令時直接加上鏡像地址
docker pull registry.docker-cn.com/myname/myrepo:mytag
或者,可以編輯 /etc/docker/daemon.json
文件并添加上 registry-mirrors 鍵值。
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
修改保存后重啟 Docker 以使配置生效。
Vagrant
貌似沒有國內鏡像,但是有不少單位做的packages(大多是基于virtualbox的)放在了自家服務器上供下載。比如清華的ubuntu鏡像
https://mirror.tuna.tsinghua.edu.cn/ubuntu-cloud-images/