Chinaunix首页 | 论坛 | 博客
  • 博客访问: 971133
  • 博文数量: 109
  • 博客积分: 1751
  • 博客等级: 上尉
  • 技术积分: 1817
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-31 22:37
文章分类

全部博文(109)

文章存档

2014年(9)

2013年(21)

2012年(48)

2011年(31)

分类: LINUX

2012-03-23 18:46:31

Download all the deb package and depenant data using apt-mirror, and provide download service by apache.

1, install apt-mirror and apache2
#apt-get install apt-mirror apache2

2, config apt-mirror
#vim /etc/apt/mirror.list
Be sure the base_path you set has enough space to store the package data. In general, the size of the package data should greater than 30G. Ubuntu 910 is 32G, while Ubuntu 11.10 is 90G, for example.

点击(此处)折叠或打开

  1. ############# config ##################
  2. #
  3. set base_path /var/spool/apt-mirror
  4. #
  5. # set mirror_path $base_path/mirror
  6. # set skel_path $base_path/skel
  7. # set var_path $base_path/var
  8. # set cleanscript $var_path/clean.sh
  9. # set defaultarch <running host architecture>
  10. # set postmirror_script $var_path/postmirror.sh
  11. # set run_postmirror 0
  12. set nthreads 20
  13. set _tilde 0
  14. #
  15. ############# end config ##############

  16. deb http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
  17. deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
  18. deb http://old-releases.ubuntu.com/ubuntu/ karmic universe
  19. deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
  20. deb http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
  21. deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
  22. deb http://old-releases.ubuntu.com/ubuntu/ karmic-security main restricted
  23. deb http://old-releases.ubuntu.com/ubuntu/ karmic-security universe
  24. deb http://old-releases.ubuntu.com/ubuntu/ karmic-security multiverse

  25. deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
  26. deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
  27. deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
  28. deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
  29. deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
  30. deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
  31. deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
  32. deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
  33. deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
  34. deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted

  35. clean http://old-releases.ubuntu.com/ubuntu/

3, download the package data
#su - apt-mirror -c apt-mirror
This will be a long time depends on your download spead. Wait patient.

4, Link the data directory to apache root
By default, the apache root directory is /var/www. So you can change apache configure file to change its root as the apt-mirror data directory, or you can just link the apt-mirror data directory to apache root directory.

#ln -s /var/www /var/spool/apt-mirror/***


[1]

阅读(2163) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~