{"id":825,"date":"2011-03-13T21:40:36","date_gmt":"2011-03-13T13:40:36","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=825"},"modified":"2012-09-04T15:18:29","modified_gmt":"2012-09-04T07:18:29","slug":"ubuntu-apt-spy","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=825","title":{"rendered":"ubuntu\u5de5\u5177\u4e4bapt\u7684\u4f7f\u7528 | apt-spy\u7684\u5e94\u7528"},"content":{"rendered":"<p>\u529e\u516c\u5ba4\u4e00\u53f0\u5f04\u8fc7\u6765\u7684\u7535\u8111<br \/>\n\u88c5\u4e86debian6.0<\/p>\n<p>debian\/ubuntu \u662f\u597d\u4e1c\u897f\uff0c\u4e5f\u662f\u6211\u5e73\u65f6\u7528\u7684\u6700\u591a\u7684linux<\/p>\n<p>apt\u7ed9\u4eba\u4eec\u5e26\u6765\u7684\u5f88\u5927\u7684\u65b9\u4fbf<\/p>\n<p>\u603b\u662f\u627e\u6e90\u7684\u95ee\u9898<br \/>\n\u8fd8\u662f\u4e0d\u60f3\u9ebb\u70e6\u4e86\uff0c\u4ee5\u540e\u5c31\u7528apt-spy\u89e3\u51b3\u627e\u6e90<br \/>\n\u5230\u8fd9\u91cc\u53bb\u4e0b\u8f7d\u5bf9\u5e94\u7684\u7248\u672chttp:\/\/packages.debian.org\/sid\/i386\/apt-spy\/download<\/p>\n<p>\u4e0b\u597d\u540e<br \/>\napt-spy -d unstable -a asia -t 5<br \/>\n&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<br \/>\nTips<\/p>\n<p>* To retrieve the latest list of Debian mirrors, run (as root)<\/p>\n<p># apt-spy update<\/p>\n<p>* To find the fastest mirror in North America for testing, run<\/p>\n<p># apt-spy -d testing -a north-america<\/p>\n<p>* To find the fastest mirror in Germany for stable, run<\/p>\n<p># apt-spy -d stable -s de<\/p>\n<p>FAQ&#8217;s<\/p>\n<p>Q. What are the region (-d argument) codes?<\/p>\n<p>A. africa, asia, europe, north-america, oceania, and south-america<\/p>\n<p>Q. What if I want apt-spy to only text x mirrors?<\/p>\n<p>A. Add the argument -e x. For example, apt-spy -d unstable -a asia -e 5 would test 5 mirrors hosting unstable, and located in Asia.<\/p>\n<p>\u628asources.list\u8986\u76d6<br \/>\n#cat \/etc\/apt\/sources.list.d\/apt-spy.list &gt; \/etc\/apt\/sources.list<\/p>\n<p>\u63a5\u4e0b\u6765\u60f3\u628a\u8fd9\u4e24\u6761\u547d\u4ee4\u5199\u5230\u4e00\u4e2abash\u91cc\uff0c\u5e76\u7528cron\u6bcf\u5929\u6267\u884c\u4e00\u6b21<br \/>\n#vim \/root\/renewapt.sh<\/p>\n<p>#for update \/etc\/sources.list using apt-spy<br \/>\n#!\/bin\/bash<br \/>\napt-spy update<br \/>\napt-spy -d unstable -a asia -t 5<br \/>\ncat \/etc\/apt\/sources.list.d\/apt-spy.list &gt; \/etc\/apt\/sources.list<\/p>\n<p>#crontab -e<br \/>\n0 0 * * * bash \/root\/renewapt.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u529e\u516c\u5ba4\u4e00\u53f0\u5f04\u8fc7\u6765\u7684\u7535\u8111 \u88c5\u4e86debian6.0 debian\/ubuntu \u662f\u597d\u4e1c\u897f\uff0c\u4e5f\u662f\u6211\u5e73\u65f6\u7528\u7684\u6700\u591a\u7684linux apt\u7ed9\u4eba\u4eec\u5e26\u6765\u7684\u5f88\u5927\u7684\u65b9\u4fbf \u603b\u662f\u627e\u6e90\u7684\u95ee\u9898 \u8fd8\u662f\u4e0d\u60f3\u9ebb\u70e6\u4e86\uff0c\u4ee5\u540e\u5c31\u7528apt-spy\u89e3\u51b3\u627e\u6e90 \u5230\u8fd9\u91cc\u53bb\u4e0b\u8f7d\u5bf9\u5e94\u7684\u7248\u672chttp:\/\/packages.debian.org\/sid\/i386\/apt-spy\/download \u4e0b\u597d\u540e apt-spy -d unstable -a asia -t 5 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; Tips * To retrieve the latest list of Debian mirrors, run (as root) # apt-spy update * To find the fastest mirror in North America for testing, run # apt-spy -d testing -a north-america * To find the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-825","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=825"}],"version-history":[{"count":16,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/825\/revisions"}],"predecessor-version":[{"id":3424,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/825\/revisions\/3424"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}