Ubuntu 14.04的系统默认源是官方源,而更换为阿里云源可以提高软件安装、升级的速度,以下是更换阿里云源的步骤:
1.备份系统源
我们需要备份系统的源,以便更换失败时可以恢复,在终端下执行:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2.更换阿里云源
在终端下执行:
sudo gedit /etc/apt/sources.list
将打开的文件里的内容全部替换为:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
保存更改,关闭文件。
3.更新源
更改完源以后,我们需要更新源,执行:
sudo apt-get update
更新完成后,就可以正常安装和更新软件了。
4.恢复系统源
如果更换阿里云源出现问题,可以恢复系统源,在终端下执行:
sudo mv /etc/apt/sources.list.backup /etc/apt/sources.list
执行:
sudo apt-get update
即可恢复系统源。