1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu 24.04 の apt のリポジトリ参照先を高速な所に変更する方法

Last updated at Posted at 2025-10-17

どうやらファイルが変更になっているらしい

/etc/apt/sources.list の書き換えを解説しているところが多いが、どうやら
/etc/apt/sources.list.d/ubuntu.sources に変わっているもよう。
さらに、参照先URLも変わっているようなので、そこも国内で速いリポジトリに書き換える方法。
WSLも対象。

使えるリポジトリ一覧

ここで調べられるらしい。「Japan」でサイト内検索する。

手動で書き換える場合

sudo nano /etc/apt/sources.list.d/ubuntu.sources

(もちろん vi でも可)
URIs: http://archive.ubuntu.com/ubuntu/
という行があり、この行を以下のように書き換える(有効な行は、コメント数十行のあと、数行しかない)。
(なお、 http://security.ubuntu.com の方は書き換えてはいけないらしい。セキュリティアップデートが遅くなるとのこと。)

ICSCoE (産業サイバーセキュリティセンター, Industrial Cyber Security Center of Excellence) (IPA運営) の場合

URIs: https://ftp.udx.icscoe.jp/Linux/ubuntu/

定番のJAISTの場合

URIs: https://ftp.jaist.ac.jp/pub/Linux/ubuntu/

コマンド1行で書き換える場合

ICSCoE (IPA) の場合

sudo sed -i.bak 's!http://archive\.ubuntu\.com/ubuntu/!https://ftp.udx.icscoe.jp/Linux/ubuntu/!g' /etc/apt/sources.list.d/ubuntu.sources

JAIST の場合

sudo sed -i.bak 's!http://archive\.ubuntu\.com/ubuntu/!https://ftp.jaist.ac.jp/pub/Linux/ubuntu/!g' /etc/apt/sources.list.d/ubuntu.sources

余談

全部ここに書かれてあった・・・(書いてから気づいた)。

なお、Debian はデフォルトでかなり速いCDNが選ばれているもよう。

余談2

ICSCoEのリポジトリについて。
https://ftp/udx.icscoe.jp
ここにアクセスすると、一番下に、このプロジェクトは学術的・試験的な実証実験として提供されるものらしく、予告無く保守作業等で停止することがあるそうです。
つい先日も数日間、証明書の期限切れになっていました。
速いんですが、自己責任で。
なんならICSCoEとJAISTの両方を追加するのも良いかもしれません。(ICSCoEを先に書いて、JAISTを後に書くと、ICSCoEが失敗した時にJAISTを見に行ってくれるはず)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?