今天服务器安装个包报错Some index files failed to download. They have been ignored, or old ones used instead.?这个是啥原因??
有点懵找了一下度娘,搜出了一波东西:
MV /var/lib/apt/lists ./lists.bak # 备份
mkdir /var/lib/apt/lists # 创建新的目录
更改源:
vi /etc/apt/sources.list 将下面的源添加进去:
deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
执行:
sudo apt update
但是我发现对我没用,百思不得其解,到底怎么回事了?在仔细看下报的错误,字面上意思就是文件下载不了?于是乎我就测试下找个域名下载文件试试呗,结果直接不通,下载不了,于是乎我就ping了下度娘,也ping不通
其实答案已经很明确了,问题出在域名身上,
修改
vi /etc/resolv.conf
添加: nameserver 8.8.8.8 问题解决!