You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WSL Ubuntu 20.04执行sudo apt-get update时出现503 Service Unavailable错误求助

解决WSL Ubuntu 20.04中apt-get update持续503 Service Unavailable错误

以下是针对该问题的可行解决方案:

  • 切换WSL网络模式

    1. 打开PowerShell执行wsl --shutdown关闭所有WSL实例
    2. 在用户目录(C:\Users\<你的用户名>)下新建或编辑.wslconfig文件,添加以下内容:
      [wsl2]
      networkMode=mirrored
      
    3. 重启WSL后再次执行sudo apt-get update
  • 重置WSL与Windows网络栈
    在PowerShell中依次执行以下命令,完成后重启电脑:

    netsh winsock reset
    netsh int ip reset all
    netsh winhttp reset proxy
    ipconfig /flushdns
    wsl --shutdown
    
  • 改用HTTPS源
    编辑apt源配置文件:

    sudo nano /etc/apt/sources.list
    

    将文件中所有http://开头的源地址替换为https://,例如把http://archive.ubuntu.com/ubuntu改为https://archive.ubuntu.com/ubuntu。保存退出后执行sudo apt-get update。

  • 重置apt缓存
    执行以下命令清除旧缓存并重新拉取索引:

    sudo apt-get clean
    sudo rm -rf /var/lib/apt/lists/*
    sudo apt-get update
    
  • 排查防火墙/安全软件拦截
    暂时关闭Windows防火墙或第三方安全软件,测试是否能正常更新,确认是否存在网络拦截情况。


错误信息详情

Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
      503  Service Unavailable [IP: 91.189.91.81 80]
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
      503  Service Unavailable [IP: 91.189.91.81 80]
Err:3 http://security.ubuntu.com/ubuntu focal-security InRelease
      503  Service Unavailable [IP: 185.125.190.39 80]
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
      503  Service Unavailable [IP: 91.189.91.81 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  503  Service Unavailable [IP: 91.189.91.81 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  503  Service Unavailable [IP: 91.189.91.81 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  503  Service Unavailable [IP: 91.189.91.81 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  503  Service Unavailable [IP: 185.125.190.39 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

内容的提问来源于stack exchange,提问作者sebastian balcero

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 00:15:54