ubuntu 22.04 apt-get 安装软件报错:Temporary failure resolving ‘cn.archive.ubuntu.com‘

文章描述了在使用Ubuntu时遇到的DNS解析错误,涉及到libtcl8.6和expect包下载失败,解决办法是启用系统自带的systemd-resolved服务。
摘要由CSDN通过智能技术生成

报错信息:

在这里插入图片描述

Err:1 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 libtcl8.6 amd64 8.6.12+dfsg-1build1
Temporary failure resolving ‘cn.archive.ubuntu.com’
Err:2 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 tcl8.6 amd64 8.6.12+dfsg-1build1
Temporary failure resolving ‘cn.archive.ubuntu.com’
Err:3 http://cn.archive.ubuntu.com/ubuntu jammy/universe amd64 tcl-expect amd64 5.45.4-2build1
Temporary failure resolving ‘cn.archive.ubuntu.com’
Err:4 http://cn.archive.ubuntu.com/ubuntu jammy/universe amd64 expect amd64 5.45.4-2build1
Temporary failure resolving ‘cn.archive.ubuntu.com’
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/t/tcl8.6/libtcl8.6_8.6.12%2bdfsg-1build1_amd64.deb Temporary failure resolving ‘cn.archive.ubuntu.com’
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/t/tcl8.6/tcl8.6_8.6.12%2bdfsg-1build1_amd64.deb Temporary failure resolving ‘cn.archive.ubuntu.com’
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/e/expect/tcl-expect_5.45.4-2build1_amd64.deb Temporary failure resolving ‘cn.archive.ubuntu.com’
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/e/expect/expect_5.45.4-2build1_amd64.deb Temporary failure resolving ‘cn.archive.ubuntu.com’
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

解决方法:

启动自带的dns服务:
systemctl enable systemd-resolved.service --now
在这里插入图片描述

  • 20
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
root@6527d9173397:/# apt update Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease Temporary failure resolving 'security.ubuntu.com' Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease Temporary failure resolving 'archive.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead.
06-12

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值