ubuntu——get apt to use a mirror close to me, or choose a faster mirror

来源:互联网 发布:c 编程思想 编辑:程序博客网 时间:2024/04/30 03:57

apt-get now supports a 'mirror' method that will automatically select a good mirror based on your location. Putting:


deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse

deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse

deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse

deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse


on the top in your /etc/apt/sources.list file should be all that is needed to make it automatically pick a mirror for you based on your geographical location.

Just note that after making the change you need to run sudo apt-get update before doing anyapt-get install for it to use your closest mirror.



thanks: http://askubuntu.com/questions/37753/how-can-i-get-apt-to-use-a-mirror-close-to-me-or-choose-a-faster-mirror

原创粉丝点击