分享

ubuntu更换源【以openstack kilo为例】

pig2 发表于 2015-8-3 19:12:38 [显示全部楼层] 只看大图 回帖奖励 阅读模式 关闭右栏 0 19873


ubuntu或则自己的Linux有时候更新失败,那么该如何更换源。这对于经常使用Linux,但是认识不太清楚Linux同学,总感觉更换源有一层神秘面纱。
只需要两步骤即可实现.

1.首先找到源目录

参考
大数据云技术基础之Linux源:/etc/apt/sources.list文件
http://www.aboutyun.com/thread-14602-1-1.html


什么是Linux源,源与软件库是什么关系
http://www.aboutyun.com/thread-7171-1-1.html


[mw_shl_code=bash,true]cd /etc/apt/[/mw_shl_code]

[mw_shl_code=bash,true]备份:mv /etc/apt/sources.list /etc/apt/sources.list.backup[/mw_shl_code]

将更换的源放到sources.list
[mw_shl_code=bash,true]#sohu
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
#aliyun
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
#openstack kilo
deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main[/mw_shl_code]

cat sources.list
1.png

2.更新

[mw_shl_code=bash,true]sudo  apt-get update[/mw_shl_code]

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条