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.
- ############# config ##################
- #
- set base_path /var/spool/apt-mirror
- #
- # set mirror_path $base_path/mirror
- # set skel_path $base_path/skel
- # set var_path $base_path/var
- # set cleanscript $var_path/clean.sh
- # set defaultarch <running host architecture>
- # set postmirror_script $var_path/postmirror.sh
- # set run_postmirror 0
- set nthreads 20
- set _tilde 0
- #
- ############# end config ##############
- deb http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
- deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
- deb http://old-releases.ubuntu.com/ubuntu/ karmic universe
- deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
- deb http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
- deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
- deb http://old-releases.ubuntu.com/ubuntu/ karmic-security main restricted
- deb http://old-releases.ubuntu.com/ubuntu/ karmic-security universe
- deb http://old-releases.ubuntu.com/ubuntu/ karmic-security multiverse
- deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
- deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
- deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
- deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
- deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
- deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
- deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
- deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
- deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
- deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
- 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) |