WSL配置源

WSL配置源


前言

WSL安装g++显示找不到包,于是定位到源的问题,看了很多大多是 /etc/apt/sources.list 文件下更新成国内源,然后执行sudo apt-get update sudo apt-get upgrade,前者是更新软件列表,后者是软件升级,结果update就报错:

Ign:1 http://mirrors.aliyun.com/ubuntu jammy InRelease
Ign:2 http://mirrors.aliyun.com/ubuntu jammy-security InRelease
Ign:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease
Ign:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease
Ign:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease
Ign:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease
Ign:7 http://mirrors.163.com/ubuntu jammy InRelease
Ign:8 http://mirrors.163.com/ubuntu jammy-security InRelease
Ign:9 http://mirrors.163.com/ubuntu jammy-updates InRelease
Ign:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease
Ign:11 http://mirrors.163.com/ubuntu jammy-backports InRelease
Ign:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease
Ign:1 http://mirrors.aliyun.com/ubuntu jammy InRelease
Ign:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease
Ign:7 http://mirrors.163.com/ubuntu jammy InRelease
Ign:8 http://mirrors.163.com/ubuntu jammy-security InRelease
Ign:2 http://mirrors.aliyun.com/ubuntu jammy-security InRelease
Ign:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease
Ign:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease
Ign:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease
Ign:9 http://mirrors.163.com/ubuntu jammy-updates InRelease
Ign:11 http://mirrors.163.com/ubuntu jammy-backports InRelease
Ign:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease
Ign:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease
Ign:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease
Ign:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease
Ign:7 http://mirrors.163.com/ubuntu jammy InRelease
Ign:1 http://mirrors.aliyun.com/ubuntu jammy InRelease
Ign:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease
Ign:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease
Ign:8 http://mirrors.163.com/ubuntu jammy-security InRelease
Ign:9 http://mirrors.163.com/ubuntu jammy-updates InRelease
Ign:2 http://mirrors.aliyun.com/ubuntu jammy-security InRelease
Ign:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease
Ign:11 http://mirrors.163.com/ubuntu jammy-backports InRelease
Ign:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease
Err:1 http://mirrors.aliyun.com/ubuntu jammy InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease
  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:2 http://mirrors.aliyun.com/ubuntu jammy-security InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:7 http://mirrors.163.com/ubuntu jammy InRelease
  Temporary failure resolving 'mirrors.163.com'
Err:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease
  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease
  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease
  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:8 http://mirrors.163.com/ubuntu jammy-security InRelease
  Temporary failure resolving 'mirrors.163.com'
Err:9 http://mirrors.163.com/ubuntu jammy-updates InRelease
  Temporary failure resolving 'mirrors.163.com'
Err:11 http://mirrors.163.com/ubuntu jammy-backports InRelease
  Temporary failure resolving 'mirrors.163.com'
Reading package lists... Done
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://mirrors.aliyun.com/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

(注:源更新注意系统版本,不同版本有不同代号:
Ubuntu 22.04:jammy
Ubuntu 20.04:focal
Ubuntu 18.04:bionic
Ubuntu 16.04:xenia)
按照网上帖子在/etc/resolv.conf中添加nameserver 8.8.8.8或者nameserver 114.114.114.114,执行update,报错仍如上,发现这个文件是系统每次启动时自动生成,修改没用;然后在/etc/wsl.conf中添加:

[network]
generateResolvConf = false

重启后重新在/etc/resolv.conf中添加nameserver 8.8.8.8或者nameserver 114.114.114.114成功
遇见:E: Unable to locate package gcc,如果源配置没问题的话,就重新执行:sudo apt-get install gcc。


根据提供的引用内容,你可以通过以下步骤在WSL配置Anaconda: 1. 激活虚拟环境jittorU,使用命令`conda activate jittorU`。如果在激活时遇到问题,可能会出现`CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.`的错误提示。解决方法是执行`conda activate jittorU`命令。 2. 测试是否安装成功,可以使用以下命令测试CUDA环境:`python3.8 -m jittor.test.test_example`和`python3.8 -m jittor.test.test_cudnn_op`。 3. 配置WSL的VSCode开发环境,确保你已经在WSL中安装了VSCode,并按照相关教程进行配置。 4. 如果你想直接使用豆瓣进行安装,首先需要配置豆瓣镜像。你可以使用以下命令安装所需的软件包:`pip install torch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1`。请确保你已经按照引用\[3\]中提供的链接配置了豆瓣镜像。 希望以上步骤对你有帮助! #### 引用[.reference_title] - *1* *2* [【Jittor入门之一】环境配置WSL + Anaconda +VSCode](https://blog.csdn.net/weixin_45021960/article/details/127644074)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [WSL中安装Anaconda3并建立独立环境【pytorch1.8】](https://blog.csdn.net/weixin_43135178/article/details/124290254)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值