1. 首先备份源列表
首先备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
2. 而后打开sources.list文件修改
sudo vim /etc/apt/sources.list
3. 用下面阿里原替换掉文件中所有的内容,保存编辑好的文件(最好不要这样,只需手动替换list文件的非注释链接,否则可能会造成aptitude工具与apt工具不兼容(需要卸载apt)2020.02.02亲测)
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
4. 然后刷新列表,注意一定要执行刷新(只需执行前两个)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
#强制的:sudo apt-get -y update
参考资料:
https://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8
https://blog.csdn.net/u010053463/article/details/49300625
https://blog.csdn.net/wang725/article/details/79902004
https://www.cnblogs.com/cyttina/archive/2013/01/29/2882111.html
版权属于:soarli
本文链接:https://blog.soarli.top/archives/43.html
转载时须注明出处及本声明。