LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 919|回复: 4

[请教]我想在局域网中建立一个Debian的安装源!我应该怎么做?

[复制链接]
发表于 2005-10-9 20:24:41 | 显示全部楼层 |阅读模式
大家好!
  我的FTP局域网服务器上用很大的空间空着!我想做一个像www.geekbone.org的安装源
我应该怎么做? 谢谢!
发表于 2005-10-9 21:29:35 | 显示全部楼层
  1. 6.4.11 本地软件包文件

  2. 为了创建与 APT 和 dselect 系统兼容的本地软件包文件,需要创建 Packages,包中文件要放在特定的目录树中。

  3. Debian 官方包文件喜欢存放于本地 deb 仓库,下面就来创建仓库:

  4.      # aptitude install dpkg-dev
  5.      # cd /usr/local
  6.      # install -d pool # 软件包存放的物理地址
  7.      # install -d dists/unstable/main/binary-i386
  8.      # ls -1 pool | sed 's/_.*$/ priority section/' | uniq > override
  9.      # 编辑 override # 调整 priority and section
  10.      # dpkg-scanpackages pool override /usr/local/ \
  11.         > dists/unstable/main/binary-i386/Packages
  12.      # cat > dists/unstable/main/Release << EOF
  13.      Archive: unstable
  14.      Version: 3.0
  15.      Component: main
  16.      Origin: Local
  17.      Label: Local
  18.      Architecture: i386
  19.      EOF
  20.      # echo "deb file:/usr/local unstable main" \
  21.         >> /etc/apt/sources.list

  22. 还有一种快速但是肮脏的方法来创建本地 deb 仓库:

  23.      # aptitude install dpkg-dev
  24.      # mkdir /usr/local/debian
  25.      # mv /some/where/package.deb /usr/local/debian
  26.      # dpkg-scanpackages /usr/local/debian /dev/null | \
  27.        gzip - > /usr/local/debian/Packages.gz
  28.      #  echo "deb file:/usr/local/debian ./" >> /etc/apt/sources.list

  29. 在 /etc/apt/sources.list 中设置相应镜像源入口地址,就可以通过 HTTP 或 FTP 方式远程访问存放在其中的包文件了。
复制代码
回复 支持 反对

使用道具 举报

发表于 2005-10-9 22:31:20 | 显示全部楼层
Use apt-proxy:
       #apt-get install apt-proxy
apt-proxy starts up automatically installation. (See Apt-proxy home page: http://apt-proxy.sourceforge.net)
Next, edit the add_backend/debian/ section of /etc/apt-proxy/apt-proxy.conf  so that it points to geographically close package mittors. (U may check and see http://debian.org/mirror/list for a list of package mirrors.)

Now edit /etc/sources.list on the client machines  to point to the apt-peoxy server.
The default port is 9999:
        deb http://ip-or-hostname:9999/main stable main contrib non-free
        deb http://ip-or-hostname:9999/non-US stable/non-US main contrib non-free
        deb http://ip-or-hostname:9999/security stable/updates main contrib non-free

Run apt-get update on the client machines,and u're in bussiness.Every time a client machine on your LAN installs a new program,it will be cached on the apt-proxy server.Subsequent requests for the same package will bu served bu the lical cache.

Most of the default settings in /etc/apt-proxy/apt-proxy.conf , other than the package source, are just fine,except fot one thing:the"update" frequency,which specifies how often to download the latest packages list ,This is the default:
         # Maximum frequency of Packages/etc. update from back end(minutes)
         # Keep high to speed things up.
         BACKEND_FREQ=240
I set mine to 1440;once a day is plenty. There's really not so much happening that more frequent update are nessary. The main reason to check as often as once a day is to stay on top of security updates.
回复 支持 反对

使用道具 举报

发表于 2005-10-10 08:26:55 | 显示全部楼层
那做这么一个apt-proxy大概需要多少空间?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-10-10 10:38:38 | 显示全部楼层
请问在 win2000 下如何建立 debain的安装源?谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表