天天看點

快速設定debian源

如何設定快速的debian源 ?

使用apt-spy,可以自動測試到哪個源的下載下傳速度最快,并自動将最快的源寫入配置檔案 。

如果沒有apt-spy,先用apt-get安裝一個apt-spy。方法如下。

1)設定臨時源

vi /etc/apt/sources.list

#添加以下一行到檔案最後

deb http://http.us.debian.org/debian stable main

2)更新軟體包清單并安裝apt-spy

apt-get update

apt-get install apt-spy

3)自動下載下傳清單并使用apt-spy測試最快的源

apt-spy update

apt-spy -d stable -a Asia -t 10

4)檢視生成的配置檔案,裡面是最快的源

cat /etc/apt/sources.list.d/apt-spy.list

5)将apt-spy.list中生成的源位址拷貝到sources.list

6)删除臨時源

vi /etc/apt/sources.list

#删除以下一行

deb http://http.us.debian.org/debian stable main

7)更新軟體包清單

apt-get update

到此完成。 

如果想了解更多關于apt-spy,請通過man檢視。