ubuntu无法更新的问题,提示错误Err http://mirrors.163.com trusty Release.gpg Could not resolve 'mirrors.163.com

本文介绍在Ubuntu系统中配置源文件时遇到的DNS解析错误问题及其解决方法。通过检查DNS配置并手动添加正确的DNS服务器地址,可以解决无法获取软件包列表的问题。

最近在安装使用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

问题解决。。。

Ign:1 http://mirrors.aliyun.com/ubuntu trusty InRelease Get:2 http://mirrors.aliyun.com/ubuntu trusty-security InRelease [56.5 kB] Get:3 http://mirrors.aliyun.com/ubuntu trusty-updates InRelease [56.5 kB] Get:4 http://mirrors.aliyun.com/ubuntu trusty-proposed InRelease [56.5 kB] Get:5 http://mirrors.aliyun.com/ubuntu trusty-backports InRelease [56.5 kB] Hit:6 http://mirrors.aliyun.com/raspberrypi buster InRelease Get:7 http://mirrors.aliyun.com/ubuntu trusty Release [58.5 kB] Err:2 http://mirrors.aliyun.com/ubuntu trusty-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 Get:8 http://mirrors.aliyun.com/ubuntu trusty Release.gpg [933 B] Err:3 http://mirrors.aliyun.com/ubuntu trusty-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 Err:4 http://mirrors.aliyun.com/ubuntu trusty-proposed InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 Err:5 http://mirrors.aliyun.com/ubuntu trusty-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 Ign:8 http://mirrors.aliyun.com/ubuntu trusty Release.gpg Reading package lists... Done W: GPG error: http://mirrors.aliyun.com/ubuntu trusty-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu trusty-security InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu trusty-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu trusty-updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu trusty-proposed InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu trusty-proposed InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu trusty-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu trusty-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu trusty Release' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
最新发布
09-08
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值