岂止于建站

Ubuntu更换阿里云源地址解决update更新错误问题

如果我们有在使用VPS主机的时候会发现两个可能的系统问题,一种是我们在update更新源的时候有报错,一种是默认是海外源,更新起来比较慢。所以我们如果有以上两个问题,可以使用更换源的办法,这里我们使用的是Ubuntu系统,因为这个系统还是比较常用的。默认是官方自带的源,这里我们需要更换成国内阿里云的源。

第一、备份默认源

cp /etc/apt/sources.list /etc/apt/sources_init.list

第二、更换源通道

vi /etc/apt/sources.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

第三、更新软件和源

apt-get update && upgrade

这里我们就可以使用最新系统进行安装软件。PS:如果我们需要使用其他源,这里贴上163的源,我们有需要也可以使用。

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

未经允许不得转载:老部落 » Ubuntu更换阿里云源地址解决update更新错误问题

关注微信公众号(imweber)和站长交流QQ群(594467847)获取新知和交流。