提款姬 2021-07-06 23:12 采纳率: 0%
浏览 359

WSL2 Ubuntu 20.04 怎么进行update?

我更新了源,也添加了DNS,但还是无法进行update,代码如下:

(base) ruoruo@DESKTOP-5SC16P5:/etc/network$ sudo cat /etc/resolv.conf

This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:

[network]

generateResolvConf = false

nameserver 8.8.8.8
nameserver 8.8.4.4
(base) ruoruo@DESKTOP-5SC16P5:/etc/network$ sudo apt-get update
Err:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Reading package lists... Done
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Some index files failed to download. They have been ignored, or old ones used instead.
(base) ruoruo@DESKTOP-5SC16P5:/etc/network$

  • 写回答

1条回答 默认 最新

  • 我要逆风去0 2023-04-21 11:44
    关注

    首先,确保您的 WSL2 Ubuntu 20.04 系统已经安装了 update 工具。您可以在终端中运行以下命令来安装它:
    sudo apt-get update
    sudo apt-get install wsl2-client
    然后,您可以使用 WSL2 Ubuntu 20.04 内置的 update 工具进行更新。在终端中运行以下命令:

    sudo apt update
    sudo apt install apt-transport-https
    curl -s https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -o /etc/apt/sources.list.d/packages.list
    sudo apt-get update
    sudo apt-get install WSL2-Ubuntu
    这将更新您的 WSL2 Ubuntu 20.04 系统,并安装最新版本的 WSL2 Ubuntu。http://www.7zhan.net/

    最后,您可以重新启动您的 WSL2 Ubuntu 20.04 系统,以便更新生效。在终端中运行以下命令:
    sudo systemctl restart wslf2

    评论

报告相同问题?

悬赏问题

  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集