首页 > 其他分享 >WSL2--DNS解析问题解决

WSL2--DNS解析问题解决

时间:2024-06-02 11:32:24浏览次数:11  
标签:http InRelease -- WSL2 DNS ubuntu security com archive

1.问题

xurong@DESKTOP-SOE9MG1:~/.ssh$ sudo apt update
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Err:2 http://archive.ubuntu.com/ubuntu noble InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:1 http://security.ubuntu.com/ubuntu noble-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/noble-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
xurong@DESKTOP-SOE9MG1:~/.ssh$ sudo apt update
Ign:1 http://security.ubuntu.com/ubuntu Nobel-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu 高贵的 InRelease
Ign:3 http://archive.ubuntu.com/ubuntu Nobel-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu Nobel-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu 高贵的 InRelease
Ign:1 http://security.ubuntu.com/ubuntu Nobel-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu Nobel-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu Nobel-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu 高贵的 InRelease
Ign:1 http://security.ubuntu.com/ubuntu Nobel-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu Nobel-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu Nobel-backports InRelease
错误:2 http://archive.ubuntu.com/ubuntu 高贵的 InRelease
  暂时无法解析“archive.ubuntu.com”
错误:1 http://security.ubuntu.com/ubuntu Nobel-security InRelease
  暂时无法解析“security.ubuntu.com”
错误:3 http://archive.ubuntu.com/ubuntu Nobel-updates InRelease
  暂时无法解析“archive.ubuntu.com”
错误:4 http://archive.ubuntu.com/ubuntu Nobel-backports InRelease
  暂时无法解析“archive.ubuntu.com”
正在阅读包裹清单...完成
构建依赖树...完成
读取状态信息...完成
可以升级5个包。运行“apt list --upgradable”来查看它们。
W:无法获取 http://archive.ubuntu.com/ubuntu/dists/noble/InRelease 解决“archive.ubuntu.com”临时失败
W:无法获取 http://archive.ubuntu.com/ubuntu/dists/noble-updates/InRelease 解决“archive.ubuntu.com”临时失败
W:无法获取 http://archive.ubuntu.com/ubuntu/dists/noble-backports/InRelease 解决“archive.ubuntu.com”临时失败
W:无法获取 http://security.ubuntu.com/ubuntu/dists/noble-security/InRelease 解决“security.ubuntu.com”临时失败

2.解决问题

临时更改 DNS 服务器:您可以临时将 DNS 服务器更改为公共 DNS 服务器,例如 Google(8.8.8.8 和 8.8.4.4)或 Cloudflare (1.1.1.1)。为此,请编辑 /etc/resolv.conf 文件

xurong@DESKTOP-SOE9MG1:/etc$ sudo vim /etc/resolv.conf
xurong@DESKTOP-SOE9MG1:/etc$ sudo rm /etc/resolv.conf
xurong@DESKTOP-SOE9MG1:/etc$ sudo touch /etc/resolv.conf
xurong@DESKTOP-SOE9MG1:/etc$ sudo vim resolv.conf
xurong@DESKTOP-SOE9MG1:/etc$ more resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

如果resolv.conf是一个链接文件,需要先将其删除,然后在创建添加内容

3.成功

标签:http,InRelease,--,WSL2,DNS,ubuntu,security,com,archive
From: https://www.cnblogs.com/rong-xu-drum/p/18226928

相关文章

  • 【C语言】文件操作(中卷)
    前言在文件操作(上卷)中,讲到的主要都是正式文件操作开始之前的前置知识,而这一卷中,我们将开始正式地操作文件。在上卷中我们已经说到,stdinstdoutstderr是三个C语言程序启动时默认打开的流。这三个流的类型是:FILE*,通常称为文件指针。而C语言,就是通过FILE*的文件指针来维护流的......
  • 43-1 应急响应 - Windows入侵排查实验
     环境准备:(我之前学过b站web小迪安全的免费教程所以有点安全基础,这里就自己尝试搭建一下靶场吧)1.我这里使用CS随便生成一个木马,然后复制到windows虚拟机中运行黑客必备利器:如何在系统上安装和使用CobaltStrike(简称:CS)_cobaltstrike-CSDN博客2.然后在windows靶机中给......
  • 43-2 Linux入侵排查实验
    环境准备:老规则,我没有靶场就自己搭建了类似, 这里准备一台CentOS7虚拟机作为受害者,然后使用CS制作木马并在受害者主机上线,具体过程可以看我之前写的一篇文章:黑客必备利器:如何在系统上安装和使用CobaltStrike(简称:CS)_cobaltstrike-CSDN博客 最终的效果一、事件背景:客......
  • 双指针练习:盛水最多的容器
    题目链接:11.盛水最多的容器题目描述:给定一个长度为 n 的整数数组 height 。有 n 条垂线,第 i 条线的两个端点是 (i,0) 和 (i,height[i]) 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。返回容器可以储存的最大水量。说明:你不能倾斜......
  • 双指针练习:复写0
    1.题目链接:1089.复写零2.题目描述:给你一个长度固定的整数数组 arr ,请你将该数组中出现的每个零都复写一遍,并将其余的元素向右平移。注意:请不要在超过该数组长度的位置写入元素。请对输入的数组 就地 进行上述修改,不要从函数返回任何东西。3.解法(原地复写-双指针):算法......
  • 17 晋升是不是技术到位、项目做好就够了?
    到今天为止,我已经用前9讲帮你搭建起一个简单易用的管理框架,那么当你做好本职工作,掌握管理的基本框架和方法之后,怎么灵活运用呢?答案是结合工作中的常见痛点问题进行参照性的演练。那么从今天开始,我们进入最后一个模块“技术管理的常见痛点”。这个模块不再是纯技术内容和理论......
  • Qt for Android 轻松解决编译器无法被识别问题!!
        相信很多小伙伴,也碰到过这种问题。明明下载Qt时,勾选了安卓组件,JDK,NDK、SDK都配置成功,但还是没有安卓编译器,或者是编译器前面有黄色感叹号,无法使用编译器。下面有解决办法。    解决方法:        1、Qt缓存导致(解决大部分问题):        ......
  • stm32 f4 SRAM
        备用SRAM是很好的临时数据保存单元,一些需要掉电后保存的数据建议使用备用SRAM保存,只有需要永久保存的数据再用FLASH进行保存。SRAM地址范围电源与复位相关的库文件(备用域的电池管理)#ifndefBKPSRAM_BKPSRAM_H_#defineBKPSRAM_BKPSRAM_H_#include"stm32......
  • CSS动画效果(炫酷登录页面)
    1.整体效果https://mmbiz.qpic.cn/sz_mmbiz_gif/EGZdlrTDJa6ibiceejK9loT70yREYASOhuSRaI6vQtQ42zN48oafaWDzdndicRuicL31ZuK3mhD82oJThcFHYuSCkw/640?wx_fmt=gif&from=appmsg&wxfrom=13一个酷炫的登录页不仅能够吸引用户的注意力,还能够提升品牌形象,增加用户的信任感。C......
  • 电机控制系列模块解析(26)—— 参数辨识
    一、离线辨识参数辨识分为:离线辨识和在线辨识。在现代电机控制领域,准确掌握电机的各项电气和机械参数对于实现高效、精准的控制至关重要。离线辨识作为电机参数测量的一种重要手段,主要在电机未接入实际运行系统时进行,通过特定的测试信号和算法,辨识出电机的关键参数。本文将介......