码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu 更换系统源和pip源

时间:2018-01-15 17:35:35      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:更换   默认   ubuntu   mysql   span   gpo   color   aliyun   pip   

1 . 备份

cd /etc/apt
sudo cp sources-list sources-list.bak

 

2 . 编辑
这里用了阿里云的源

sudo vi sources-list


将文件内容替换成以下:

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

3 . 更新

sudo apt-get updata


更新pip源
1 . 可以直接在pip时加入参数
比如:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple mysqldb

 

2 . 修改默认设置
在根目录下创建.pip目录,创建pip.conf,并写入

[global]

index-url = http://pypi.douban.com/simple

[install]

trusted-host=pypi.douban.com

 

ubuntu 更换系统源和pip源

标签:更换   默认   ubuntu   mysql   span   gpo   color   aliyun   pip   

原文地址:https://www.cnblogs.com/benjamin77/p/8288797.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!