ubuntu修改软件源的方法

最快方法——替换法

刚安装好的ubutun,打开source.list后,用vim替换的方法将所有的us提付出替换为
cn,然后保存退出,更新即可。

# vim /etc/apt/source.list
# 在vim的界面输入 %s/us/cn/g,保存退出
# apt-get update

%s/us/cn/g, g是全局的意思。%s是替换。
ps vim的常用指令还有哪些? vim编程要做哪些配置?

修改软件源为本地镜像源

把 /etc/apt/source.list中的内容替换为阿里云的源。

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

原文地址:https://www.cnblogs.com/goto2091/p/13682417.html