sudo apt update ができない


# 実行環境
- OS
wsl2 Ubuntu24.04

# エラー内容

- `sudo apt update` コマンドを実行したところ以下のエラー
- エラー文は、
	- E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages  Connection failed [IP: 91.189.91.83 80]
	- E: Some index files failed to download. They have been ignored, or old ones used instead.

```
:~/workspace$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [89.7 kB]
Get:2 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [26.7 kB]
Get:3 http://security.ubuntu.com/ubuntu noble-security/main Translation-en [8124 B]
Get:4 http://security.ubuntu.com/ubuntu noble-security/main amd64 c-n-f Metadata [108 B]
Get:5 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [10.6 kB]
Get:6 http://security.ubuntu.com/ubuntu noble-security/universe Translation-en [4596 B]
Get:7 http://security.ubuntu.com/ubuntu noble-security/universe amd64 c-n-f Metadata [112 B]
Get:8 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 c-n-f Metadata [116 B]
Get:9 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 c-n-f Metadata [116 B]
Get:10 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble-updates InRelease [89.7 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble-backports InRelease [89.7 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1401 kB]    
Get:14 http://archive.ubuntu.com/ubuntu noble/main Translation-en [513 kB]     
Get:15 http://archive.ubuntu.com/ubuntu noble/main amd64 Components [464 kB]   
Get:16 http://archive.ubuntu.com/ubuntu noble/main amd64 c-n-f Metadata [30.5 kB]
Ign:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages          
Get:18 http://archive.ubuntu.com/ubuntu noble/universe Translation-en [5982 kB]
Get:19 http://archive.ubuntu.com/ubuntu noble/universe amd64 Components [3871 kB]                 
Get:20 http://archive.ubuntu.com/ubuntu noble/universe amd64 c-n-f Metadata [301 kB] 
Get:21 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [93.9 kB]
Get:22 http://archive.ubuntu.com/ubuntu noble/restricted Translation-en [18.7 kB]
Get:23 http://archive.ubuntu.com/ubuntu noble/restricted amd64 c-n-f Metadata [416 B]
Get:24 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [269 kB]
Get:25 http://archive.ubuntu.com/ubuntu noble/multiverse Translation-en [118 kB]
Get:26 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Components [35.0 kB]
Get:27 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 c-n-f Metadata [8328 B]
Get:28 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [28.4 kB]
Get:29 http://archive.ubuntu.com/ubuntu noble-updates/main Translation-en [8996 B]                
Get:30 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 c-n-f Metadata [108 B]           
Get:31 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [17.6 kB]           
Get:32 http://archive.ubuntu.com/ubuntu noble-updates/universe Translation-en [6096 B]            
Get:33 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 c-n-f Metadata [112 B]       
Get:34 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 c-n-f Metadata [116 B]     
Get:35 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 c-n-f Metadata [116 B]     
Get:36 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 c-n-f Metadata [112 B]         
Get:37 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [3936 B]          
Get:38 http://archive.ubuntu.com/ubuntu noble-backports/universe Translation-en [1392 B]          
Get:39 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 c-n-f Metadata [116 B]     
Get:40 http://archive.ubuntu.com/ubuntu noble-backports/restricted amd64 c-n-f Metadata [116 B]   
Get:41 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 c-n-f Metadata [116 B]   
Ign:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages                             
Ign:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Ign:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Err:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
  Connection failed [IP: 91.189.91.83 80]
Ign:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Err:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
  Connection failed [IP: 91.189.91.83 80]
Ign:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Err:17 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
  Connection failed [IP: 91.189.91.83 80]
Fetched 13.8 MB in 7min 53s (29.1 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages  Connection failed [IP: 91.189.91.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
```

- 以下記事を参考に、パッケージリストを削除したが解決しなかったので、私の場合はパッケージリストの問題ではないのかもしれない。
[Ubuntu 18.04 sudo apt-get updateコマンド が Failed to fetchエラーになった時の解決法 #初心者 - Qiita](https://qiita.com/miriwo/items/bc2c0f18ee7d6f337ed0)
(記事の構成も参考にというかパクッてしまってすみません)

# 解決法

- 公開Ubuntuミラーサーバーに切り替える
- 以下のコマンドを実行
```
sudo sed -i.bak -r 's@http://(jp\.)?archive\.ubuntu\.com/ubuntu/?@https://ftp.udx.icscoe.jp/Linux/ubuntu/@g' /etc/apt/sources.list.d/ubuntu.sources
```
- ダウンロードがかなり早くなって嬉しい
# 参考

[Ubuntu 18.04 sudo apt-get updateコマンド が Failed to fetchエラーになった時の解決法 #初心者 - Qiita](https://qiita.com/miriwo/items/bc2c0f18ee7d6f337ed0)

[Ubuntuのapt mirrorの設定って結局どうすればいいの？](https://zenn.dev/ciffelia/articles/c394962a8f188a)

[sedだけでバックアップをとりつつ安全に上書き置換する #Bash - Qiita](https://qiita.com/nagamee/items/ec81f82bbfd59c0181be)

[【Ubuntu】コマンド一発で「アーカイブミラー」を切り替えるには？【アプデ高速化】 | LFI](https://linuxfan.info/ubuntu-switch-archive-mirror-command)

[コマンドラインで ubuntu の apt の取得先をミラーに変更する #Ubuntu - Qiita](https://qiita.com/m-tmatma/items/506ed55fc6986170e52a)