ubuntu修改软件源的方法

最快方法——替换法

刚安装好的ubutun,打开source.list后,用vim替换的方法将所有的us提付出替换为
cn,然后保存退出,更新即可。此方法适用于新安装好的无外界ssh连接的ubuntu服务器上直接修改。

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

%s/us/cn/g, g是全局的意思。%s是替换。

修改软件源为本地镜像源

把 /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

posted @ 2020-09-04 09:50  goto2091  阅读(500)  评论(0)    收藏  举报