Raspbianのソフトウェアアップデートをする場合、デフォルトだと以下のURLになっています。
http://raspbian.raspberrypi.org/raspbian/
これを日本のサーバに変更することにより、Raspbianのアップデートファイルのダウンロードが早くなります。
(近いサーバなので当然ですよね。)
以下、リポジトリサーバの変更手順を記します。
設定変更を行ったRaspbianのバージョンは以下の通りです。
$ lsb_release -dr Description: Raspbian GNU/Linux 10 (buster) Release: 10
/etc/apt/sources.listファイルにリポジトリサーバの情報が記載されています。
本ファイルを日本のサーバに変更することになります。
以下、URLをブラウザで確認するとミラーの一覧が表示されます。
http://www.raspbian.org/RaspbianMirrors
日本に関しては以下の3つが記載されていました。
CONTINENT | COUNTRY | MIRROR | DEB/DEB-SRC ADDRESS |
Asia | Japan | JAIST | http://ftp.jaist.ac.jp/raspbian (http|rsync)://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian |
Asia | Japan | WIDE Project Tsukuba NOC | http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian/ rsync://ftp.tsukuba.wide.ad.jp/raspbian/raspbian/ |
Asia | Japan | Yamagata University | http://ftp.yz.yamagata-u.ac.jp/pub/linux/raspbian/raspbian/ |
本資料では、JAIST 北陸先端科学技術大学院大学が公開しているリポジトリサーバを利用する手順を記します。
使用するJAIST 北陸先端科学技術大学院大学のリポジトリURLをは上記表の通り、以下のURLをになります。
http://ftp.jaist.ac.jp/raspbian
sources.listをJAIST 北陸先端科学技術大学院大学のリポジトリに変更します。
本資料では、テキストエディタにLeafPadを使用します。
他のテキストエディタでも構いませんので、LeafPadの部分を読み替えてください。
sudo leafpad /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' #deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
http://raspbian.raspberrypi.org/raspbian/
http://ftp.jaist.ac.jp/raspbian
deb http://ftp.jaist.ac.jp/raspbian buster main contrib non-free rpi # deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' #deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
上記の設定変更が終わったら、動作確認を行います。
すでにターミナル()は起動済みだと思いますので、以下のコマンドを入力し実行してみてください。
sudo apt update
以下、実際に実行したときの出力です。
変更した ftp.jaist.ac.jp が出力されています。
2行目は /etc/apt/sources.list.d/raspi.list の設定ファイルになります。
これは、http://archive.raspberrypi.org/debian なので編集対象外としました。
以上、Raspbianのリポジトリを日本のリポジトリサーバに変更した手順でした。