WSL2下的Ubuntu 24.0突然apt update报错 Could not wait for server fd 的解决方案

我在WSL下面安装了Ubuntu 24.04.1 LTS (GNU/Linux 6.6.87.2-microsoft-standard-WSL2 x86_64)。 只要一执行apt update命令,它就给我报错:

bash 复制代码
Err:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble InRelease
  Could not wait for server fd - select (11: Resource temporarily unavailable) [IP: 101.6.15.130 443]
Err:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates InRelease
  Could not wait for server fd - select (11: Resource temporarily unavailable) [IP: 101.6.15.130 443]
Err:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports InRelease
  Could not wait for server fd - select (11: Resource temporarily unavailable) [IP: 101.6.15.130 443]

搞了好久一直不知道怎么回事,也怎么也解决不了。一开始,因为wsl老是重置我的/etc/resolv.conf,然后我ping外网也ping不通,那好,我就手动修改了,现在就可以ping得通了。可是,老是出现上面的问题,而且,我感觉它的反应是很慢的,这种感觉就是网络不通的症状。可是......我能够ping得通,也是用的国内源哇?

后来,我找到了这篇文章:APT: Could not wait for server fd - select (11: Resource temporarily unavailable) [IP: 10.158.100.1 8080]

然后,按照它里面所写的,我在/etc/apt/apt.conf.d/下面新增了一个90curtin-aptproxy配置文件:

bash 复制代码
Acquire::http::Proxy "http://127.0.0.1:7890";
Acquire::https::Proxy "http://127.0.0.1:7890";

你猜怎么着?畅通了。着实是诡异的问题。

另,从这个版本开始,apt的配置做了很大的改变,开始使用DEB822 格式来配置软件源:

ini 复制代码
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# Types: deb-src
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Types: deb-src
# URIs: http://security.ubuntu.com/ubuntu/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 预发布软件源,不建议启用

# Types: deb
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# # Types: deb-src
# # URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# # Suites: noble-proposed
# # Components: main restricted universe multiverse
# # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
相关推荐
问今域中39 分钟前
Spring Boot 请求参数绑定注解
java·spring boot·后端
计算机程序设计小李同学1 小时前
婚纱摄影集成管理系统小程序
java·vue.js·spring boot·后端·微信小程序·小程序
一 乐1 小时前
绿色农产品销售|基于springboot + vue绿色农产品销售系统(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·后端·宠物
3***68842 小时前
Spring Boot中使用Server-Sent Events (SSE) 实现实时数据推送教程
java·spring boot·后端
C***u1762 小时前
Spring Boot问题总结
java·spring boot·后端
上进小菜猪2 小时前
基于 YOLOv8 的人体与行人检测智能识别实战 [目标检测完整源码]
后端
Elieal2 小时前
5 种方式快速创建 SpringBoot 项目
java·spring boot·后端
c***69302 小时前
Spring Boot实时推送技术详解:三个经典案例
spring boot·后端·状态模式
Mr -老鬼3 小时前
Rust适合干什么?为什么需要Rust?
开发语言·后端·rust
12344523 小时前
Agent入门实战-一个题目生成Agent
人工智能·后端