https://blog.csdn.net/qq_33472557/article/details/77389192
备份文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
打开文件
使用vim打开文件
sudo vim /etc/apt/sources.list
如果没有安装vim,执行下面的命令,再去执行上面的命令
sudo apt-get install vim
修改文件
将文件中的全部内容替换为以下部分:
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
注意不同版本的ubuntu所使用的源也是不同的。参照以下网址的版本代号,替换文件中出现的“trusty”
https://www.aliyun.com/jiaocheng/118875.html
本文参考:https://blog.csdn.net/qq_33472557/article/details/77389192