最近在安装使用ubuntu,并且配置源文件下载相应gcc,gdb时候,出现错误,提示报错内容为
Err http://mirrors.163.com trusty Release.gpg
Could not resolve 'mirrors.163.com'
Err http://security.ubuntu.com precise-security Release.gpg
Could not resolve 'security.ubuntu.com'
Err http://mirrors.163.com trusty-security Release.gpg
Could not resolve 'mirrors.163.com'
Err http://mirrors.163.com trusty-updates Release.gpg
Could not resolve 'mirrors.163.com'
Err http://mirrors.163.com trusty-proposed Release.gpg
Could not resolve 'mirrors.163.com'
Err http://mirrors.163.com trusty-backports Release.gpg
Could not resolve 'mirrors.163.com'
Err http://us.archive.ubuntu.com precise Release.gpg
Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com precise-updates Release.gpg
Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com precise-backports Release.gpg
Could not resolve 'us.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Could not resolve 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Could not resolve 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg Could not resolve 'us.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Could not resolve 'security.ubuntu.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/trusty-proposed/Release.gpg Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/trusty-backports/Release.gpg Could not resolve 'mirrors.163.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
如果确保更新源没错,那么可能是DNS配置的问题,解决方法:
1、运行DOS,输入ipconfig /all查看DNS的地址
2、ubuntu中获取管理员权限
3、vi /etc/resolv.conf打开配置文件,并且在最后添加nameserver ***.***.***.***(DNS)的地址,回车,再添加,search localdomain
4、重新执行sudo apt-get update
问题解决。。。
本文介绍在Ubuntu系统中配置源文件时遇到的DNS解析错误问题及其解决方法。通过检查DNS配置并手动添加正确的DNS服务器地址,可以解决无法获取软件包列表的问题。
1329

被折叠的 条评论
为什么被折叠?



