刚申请了的阿里云服务器,在其Ubuntu上用apt-get install安装软件时,会遇到:
Failed to fetch http://aliyun.com/balabala 404 Not Found
这样的问题。后来搜了一下,原因是默认的aliyun下载源不可用。
解决方法是,换一个下载源,比如网易的。以下是我的做法:
1.把以前的下载源文件删了:rm /etc/apt/sources.list。当然,怕误删最好做个备份。
2.搜一个与Ubuntu版本匹配的网易源,对于Ubuntu 14.04可参考:
3.在Windows新建一个文件sources.list,该文件保存下列内容:
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
4.用文件传输工具,如File Transfer将该sources.list上传到/etc/apt下
5.更新源:sudo apt-get update
注:核心思想就是,用新的源代替旧的源。如果你搜了个网易源,仍不管用,可能是该源很古老,现在已不可用,搜个其他的就好了。