个人工具
104.160.18.24
该IP地址的讨论
登录
查看“UbuntuHelp:AptProxy/zh”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:AptProxy/zh”的源代码
来自Ubuntu中文
←
UbuntuHelp:AptProxy/zh
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Translation}}<br>{{From|http://wiki.ubuntu.org.cn/UbuntuHelp:AptProxy}}<br>{{Translator|李威}}<br>{{Languages|UbuntuHelp:AptProxy}} === 简述 === apt-proxy程序将你从网络上下载下来的软件包缓存到本地磁盘。apt-proxy的行为就像一台包含那些你所选择软件包全部拷贝的HTTP服务器。你可以从本地网络上的其他计算机上存取这些软件包。如果软件包还没有被缓存,apt-poxy会自动下载并缓存上。这对那些需要重复安装同样软件包的人来说(如,为多台机子升级),非常有效的节约了下载带宽和安装的时间。 === 安装 === apt-proxy 已经包含在通用档案文件中。要安装,在终端中运行命令: <pre>sudo apt-get install apt-proxy</pre> === 配置apt-proxy服务器 === ==== 默认设置 ==== 在apt-proxy配置文件 ''/etc/apt-proxy/apt-proxy-v2.conf'' 的第一节中,包含了apt-proxy及其缓存的默认设置。第一步就是设置 address 参数,将其设置为内网中作为apt-proxy服务器的IP。 如果该项被注释掉,apt-proxy会监听服务器的所有的IP地址。port 参数指定了apt-proxy要监听的请求端口,其默认设置为9999,通常情况下用这个值就很合适了。 如果你想改变apt-proxy缓存软件包的目录,更改 cache_dir 参数即可。缓存目录默认设为 ''/var/cache/apt-proxy''。如果你使用了网页代理服务器(如,Squid),你可以配置apt-proxy使用代理,设置方法为 http_proxy = proxy_server:port 。如果你在防火墙之后,那么你用主动FTP连接去连接到一个FTP后端时可能会出问题。而 passive_ftp = on 应该能解决这个问题。另外的一个值控制软件包在缓存中保存多长时间。也就是说,在apt-proxy检查更新版本前软件包应至少存在了多长时间,或者说缓存中的软件包每隔多长时间查找一次更新版本。在到达这个默认值时,它们就被安全地抛弃了。 ==== Backends ==== apt-proxy has to know where to find remote repositories, which it refers to as backends. This is done via backend sections in /etc/apt-<br>proxy/apt-proxy-v2.conf. A backend entry for Ubuntu may look like this: <pre>[ubuntu] ;; Ubuntu archive backends = http://archive.ubuntu.com/ubuntu http://de.archive.ubuntu.com/ubuntu</pre> As you can see, it is possible to specify more than one server, separated by blank space. If the first server is down, apt-proxy tries to get the data from the second server and so on. Note: If the first server is up, but does not have a required file, apt-proxy will not fall back to a second server. You can also override values set in the [default-section. For instance, if you know that a special server takes very long to answer a request, you can increase the timeout value: <pre>[ubuntu-slow] timeout = 60 ;wait 1 Minute backends = prot://some.very.slow.server.net/ubuntu-slow</pre> A complete example '''apt-proxy-v2.conf'''may look like this: <pre>[DEFAULT] ;; All times are in seconds, but you can add a suffix ;; for minutes(m), hours(h) or days(d) address = 127.0.0.1 port = 9999 cache_dir = /var/cache/apt-proxy ;; Control files (Packages/Sources/Contents) refresh rate min_refresh_delay = 1s complete_clientless_downloads = 1 ;; Debugging settings. debug = all:4 db:0 timeout = 30 passive_ftp = on ;;-------------------------------------------------------------- ;; Cache housekeeping cleanup_freq = 1d max_age = 120d max_versions = 3 ;;--------------------------------------------------------------- ;; Backend servers ;; ;; Place each server in its own [section] [ubuntu] ; Ubuntu archive backends = http://archive.ubuntu.com/ubuntu http://de.archive.ubuntu.com/ubuntu [ubuntu-security] ; Ubuntu security updates backends = http://security.ubuntu.com/ubuntu [marillat] backends = http://mirrors.ecology.uni-kiel.de/debian/debian-multimedia [debian] ; Backend servers, in order of preference backends = http://ftp.us.debian.org/debian http://ftp.de.debian.org/debian http://ftp2.de.debian.org/debian ftp://ftp.uk.debian.org/debian [debian-non-US] ; Debian debian-non-US archive backends = http://ftp.uk.debian.org/debian-non-US http://ftp.de.debian.org/debian-non-US ftp://ftp.uk.debian.org/debian [security] ; Debian security archive backends = http://security.debian.org/debian-security http://ftp2.de.debian.org/debian-security [openoffice] ; OpenOffice.org packages backends = http://ftp.freenet.de/pub/debian-openoffice http://ftp.sh.cvut.cz/MIRRORS/OpenOffice.deb http://borft.student.utwente.nl/debian [apt-proxy] ; Apt-proxy new versions backends = http://apt-proxy.sourceforge.net/apt-proxy</pre> Note that you don't specify versions of distributions in this file; by enabling Ubuntu, you gain the ability to proxy for all versions (Hoary, Breezy, Dapper etc). What is downloaded depends on what is configured in the sources.list file on each client. <br><br>
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
模板:Translator
(
查看源代码
)
返回至
UbuntuHelp:AptProxy/zh
。