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

Ubuntu新手执行sudo apt-get update时出现503服务不可用错误求助

解决Ubuntu执行sudo apt-get update时的503服务不可用错误

问题重现

执行命令:

sudo apt-get update

出现以下错误输出:

Err:118 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 48x48 Icons  503  Service Unavailable [IP: 185.125.190.36 80]
Err:119 http://archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64 Icons  503  Service Unavailable [IP: 185.125.190.36 80]
Fetched 1213 kB in 13s (90.4 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/universe/dep11/icons-48x48.tar  503  Service Unavailable [IP: 185.125.190.36 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/universe/dep11/icons-64x64.tar  503  Service Unavailable [IP: 185.125.190.36 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

此前多次执行apt-get update均出现类似503错误。

解决方案

1. 等待官方源恢复

503错误多为Ubuntu官方源的临时故障,间隔一段时间后重新执行更新命令即可:

sudo apt-get update

2. 更换国内镜像源

国内镜像源稳定性更强,以Ubuntu 20.04(focal)为例,操作步骤如下:

  • 备份原源列表:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  • 编辑源列表文件:
sudo nano /etc/apt/sources.list
  • 将文件内容替换为阿里云镜像源(也可替换为清华、中科大等其他国内源):
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  • 保存退出(按Ctrl+O回车确认,再按Ctrl+X退出),重新执行更新:
sudo apt-get update

3. 临时禁用backports源(若无需使用)

如果暂时不需要backports源的内容,可通过注释相关条目避免错误:

  • 编辑源列表:
sudo nano /etc/apt/sources.list
  • 找到所有包含focal-backports的行,在行首添加#注释掉,保存后执行更新:
sudo apt-get update

后续需要启用时,删除对应行首的#即可。

4. 清理APT缓存后重试

清理本地缓存,重新获取索引文件:

sudo apt-get clean
sudo apt-get update

内容的提问来源于stack exchange,提问作者Mmm Mmmm

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.04 08:01:00