特殊:Badtitle/NS100:Apt-Cacher-Server
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Apt-Cacher-Server }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/af | • {{#if: UbuntuHelp:Apt-Cacher-Server|Afrikaans| [[::Apt-Cacher-Server/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ar | • {{#if: UbuntuHelp:Apt-Cacher-Server|العربية| [[::Apt-Cacher-Server/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/az | • {{#if: UbuntuHelp:Apt-Cacher-Server|azərbaycanca| [[::Apt-Cacher-Server/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/bcc | • {{#if: UbuntuHelp:Apt-Cacher-Server|جهلسری بلوچی| [[::Apt-Cacher-Server/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/bg | • {{#if: UbuntuHelp:Apt-Cacher-Server|български| [[::Apt-Cacher-Server/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/br | • {{#if: UbuntuHelp:Apt-Cacher-Server|brezhoneg| [[::Apt-Cacher-Server/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ca | • {{#if: UbuntuHelp:Apt-Cacher-Server|català| [[::Apt-Cacher-Server/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/cs | • {{#if: UbuntuHelp:Apt-Cacher-Server|čeština| [[::Apt-Cacher-Server/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/de | • {{#if: UbuntuHelp:Apt-Cacher-Server|Deutsch| [[::Apt-Cacher-Server/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/el | • {{#if: UbuntuHelp:Apt-Cacher-Server|Ελληνικά| [[::Apt-Cacher-Server/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/es | • {{#if: UbuntuHelp:Apt-Cacher-Server|español| [[::Apt-Cacher-Server/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/fa | • {{#if: UbuntuHelp:Apt-Cacher-Server|فارسی| [[::Apt-Cacher-Server/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/fi | • {{#if: UbuntuHelp:Apt-Cacher-Server|suomi| [[::Apt-Cacher-Server/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/fr | • {{#if: UbuntuHelp:Apt-Cacher-Server|français| [[::Apt-Cacher-Server/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/gu | • {{#if: UbuntuHelp:Apt-Cacher-Server|ગુજરાતી| [[::Apt-Cacher-Server/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/he | • {{#if: UbuntuHelp:Apt-Cacher-Server|עברית| [[::Apt-Cacher-Server/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/hu | • {{#if: UbuntuHelp:Apt-Cacher-Server|magyar| [[::Apt-Cacher-Server/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/id | • {{#if: UbuntuHelp:Apt-Cacher-Server|Bahasa Indonesia| [[::Apt-Cacher-Server/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/it | • {{#if: UbuntuHelp:Apt-Cacher-Server|italiano| [[::Apt-Cacher-Server/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ja | • {{#if: UbuntuHelp:Apt-Cacher-Server|日本語| [[::Apt-Cacher-Server/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ko | • {{#if: UbuntuHelp:Apt-Cacher-Server|한국어| [[::Apt-Cacher-Server/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ksh | • {{#if: UbuntuHelp:Apt-Cacher-Server|Ripoarisch| [[::Apt-Cacher-Server/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/mr | • {{#if: UbuntuHelp:Apt-Cacher-Server|मराठी| [[::Apt-Cacher-Server/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ms | • {{#if: UbuntuHelp:Apt-Cacher-Server|Bahasa Melayu| [[::Apt-Cacher-Server/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/nl | • {{#if: UbuntuHelp:Apt-Cacher-Server|Nederlands| [[::Apt-Cacher-Server/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/no | • {{#if: UbuntuHelp:Apt-Cacher-Server|norsk| [[::Apt-Cacher-Server/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/oc | • {{#if: UbuntuHelp:Apt-Cacher-Server|occitan| [[::Apt-Cacher-Server/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/pl | • {{#if: UbuntuHelp:Apt-Cacher-Server|polski| [[::Apt-Cacher-Server/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/pt | • {{#if: UbuntuHelp:Apt-Cacher-Server|português| [[::Apt-Cacher-Server/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ro | • {{#if: UbuntuHelp:Apt-Cacher-Server|română| [[::Apt-Cacher-Server/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/ru | • {{#if: UbuntuHelp:Apt-Cacher-Server|русский| [[::Apt-Cacher-Server/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/si | • {{#if: UbuntuHelp:Apt-Cacher-Server|සිංහල| [[::Apt-Cacher-Server/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/sq | • {{#if: UbuntuHelp:Apt-Cacher-Server|shqip| [[::Apt-Cacher-Server/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/sr | • {{#if: UbuntuHelp:Apt-Cacher-Server|српски / srpski| [[::Apt-Cacher-Server/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/sv | • {{#if: UbuntuHelp:Apt-Cacher-Server|svenska| [[::Apt-Cacher-Server/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/th | • {{#if: UbuntuHelp:Apt-Cacher-Server|ไทย| [[::Apt-Cacher-Server/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/tr | • {{#if: UbuntuHelp:Apt-Cacher-Server|Türkçe| [[::Apt-Cacher-Server/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/vi | • {{#if: UbuntuHelp:Apt-Cacher-Server|Tiếng Việt| [[::Apt-Cacher-Server/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/yue | • {{#if: UbuntuHelp:Apt-Cacher-Server|粵語| [[::Apt-Cacher-Server/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/zh | • {{#if: UbuntuHelp:Apt-Cacher-Server|中文| [[::Apt-Cacher-Server/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/zh-hans | • {{#if: UbuntuHelp:Apt-Cacher-Server|中文(简体)| [[::Apt-Cacher-Server/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Apt-Cacher-Server | UbuntuHelp:Apt-Cacher-Server | {{#if: | :}}Apt-Cacher-Server}}/zh-hant | • {{#if: UbuntuHelp:Apt-Cacher-Server|中文(繁體)| [[::Apt-Cacher-Server/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Apt-Cacher-Server|:Apt-Cacher-Server|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Apt-Cacher-Server/zh | | {{#ifexist: Apt-Cacher-Server/zh | | {{#ifeq: {{#titleparts:Apt-Cacher-Server|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Apt-Cacher-Server|1|-1|}} | zh | | }}
Introduction
This page describes the installation and configuration of apt-cacher. It was drawn from http://www.debuntu.org/how-to-set-up-a-repository-cache-with-apt-cacher and Ubuntu Hacks by Oxer, Rankin, and Childers http://www.oreilly.com/catalog/ubuntuhks/
Server Installation
1. Install apt-cacher and apache2 webserver
sudo apt-get install apt-cacher apache2
2. Enable apt-cacher
Edit /etc/default/apt-cacher and change autostart to 1
Note: I had problems doing this on a machine with apache already installed.
Then test by going to http://server/apt-cacher to verify that it's running.
Server Configuration
Edit /etc/apt-cacher/apt-cacher.conf if you want to change any options. The only one I changed was admin_email.
Client Configuration
There are two ways to configure your clients to use apt-cacher.
1. Modify your sources.list In client /etc/apt/sources.list insert apt-cacher-server/apt-cacher/ in each line, ie
deb http://archive.ubuntu.com/ubuntu/ dapper main restricted
becomes
deb http://apt-cacher-server/apt-cacher/archive.ubuntu.com/ubuntu/ dapper main restricted
Then run
apt-get update
2. Use a proxy. <If anyone knows how to make this work, please fill this section in.>
NEEDED: How to configure a laptop so that it uses apt-cacher when connected to it's home network, and the regular repository when it's not.