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
2.更新
[mw_shl_code=bash,true]sudo apt-get update[/mw_shl_code]
|