红联Linux门户
Linux帮助

Ubuntu镜像源和pypi镜像源

发布时间:2015-07-31 10:00:49来源:blog.csdn.net/dqchouyang作者:空气中的臭氧

为什么要更换镜像源啊?下载速度快啊!


Ubuntu镜像源
镜像源的位置在系统中的:
ubuntu@zhangl:~$ vim /etc/apt/sources.list
ubuntu系统(注意系统版本)原镜像内容如下:

deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main


国内163的镜像源内容如下:

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


pypi镜像源
镜像源的位置在系统中的:
在安装完pip之后,系统并没有自动生成pip.conf文件,所以要手动创建这个文件。
ubuntu@zhangl:~$ vim .pip/pip.conf

[global]
timeout=600
index-url=http://pypi.123.com/root/pypi/+simple/


timeout :以免网络慢的情况下安装包下载不完
index-url:要安装的python包存放的链接地址,(一般公司内部会有自己的包库,这里的链接就会指向自己包库的链接地址)

当然,在安装一个包的时候,可以指定包的下载位置如:

pip install flask -i http://pypi.v2ex.com/simple

-i :指到指定的internet下载包


目前国内的包链接地址如下:
http://pypi.douban.com/ 豆瓣
http://pypi.hustunique.com/ 华中理工大学
http://pypi.sdutlinux.org/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/ 中国科学技术大学


Ubuntu 15.10更新源已可用,更新到Ubuntu 15.10的方法:http://www.linuxdiyf.com/linux/11955.html

为Linux配置apt-get的更新源:http://www.linuxdiyf.com/linux/12073.html

Ubuntu 15.04更新源:http://www.linuxdiyf.com/linux/11839.html