debian 6.0.0:(AMD64:大概33.8GB)
1.apt-get install apt-mirror
2.修改配置文件/etc/apt/mirror.list :
set nthreads 20
set _tilde 0
set base_path /svn/ossource/debian600
set mirror_path $base_path/mirror
set skel_path $base_path/skel
set var_path $base_path/var
deb-amd64 squeeze main contrib non-free
deb-amd64 squeeze-updates main contrib non-free
deb-amd64 squeeze-proposed-updates main contrib non-free
clean
3.手工创建相关目录
mkdir -p /opt/ossource/debian600/mirror
mkdir -p /opt/ossource/debian600/var
mkdir -p /opt/ossource/debian600/skel
chown -R apt-mirror /opt/ossource/debian600/
4.执行
su - apt-mirror
nohup apt-mirror &
检查nohup.out日志,出现“Post Mirror script has completed”表示完成
====================================
ubuntu 12.04:(AMD64:大概93.7 GB)
1.apt-get install apt-mirror
2.修改配置文件/etc/apt/mirror.list :
set nthreads 20
set _tilde 0
set defaultarch amd64
set base_path /ossource/ubuntu1204
set mirror_path $base_path/mirror
set skel_path $base_path/skel
set var_path $base_path/var
deb precise main restricted universe multiverse
deb-src precise main restricted universe multiverse
deb precise-updates main restricted universe multiverse
deb-src precise-updates main restricted universe multiverse
deb precise-security main restricted universe multiverse
deb-src precise-security main restricted universe multiverse
deb precise-proposed main restricted universe multiverse
deb-src precise-proposed main restricted universe multiverse
deb precise-backports main restricted universe multiverse
deb-src precise-backports main restricted universe multiverse
clean
3.手工创建相关目录
mkdir -p /ossource/ubuntu1204/mirror
mkdir -p /ossource/ubuntu1204/var
mkdir -p /ossource/ubuntu1204/skel
chown -R apt-mirror /ossource/ubuntu1204/
4.执行
su - apt-mirror
nohup apt-mirror &
检查nohup.out日志,出现“Post Mirror script has completed”表示完成
===================
周期性自动同步:修改如下文件
/etc/cron.d/apt-mirror
===================
http发布:(/etc/apache2/sites-available/default)
Alias /debian /opt/ossource/debian600/mirror/ftp.us.debian.org/debian/
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Alias /ubuntu /ossource/ubuntu1204/mirror/mirrors.163.com/ubuntu/
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
===================
4、客户端的修改
现在修改/etc/apt/sources.list文件,加入或者只保留如下行,再用#apt-get update更新一次就可以了
debian:
deb squeeze main contrib non-free
deb squeeze-updates main contrib non-free
deb squeeze-proposed-updates main contrib non-free
ubuntu:
deb precise main multiverse restricted universe
deb-src precise main multiverse restricted universe
deb precise-updates main multiverse restricted universe
deb-src precise-updates main multiverse restricted universe
deb precise-backports main multiverse restricted universe
deb-src precise-backports main multiverse restricted universe
deb precise-security main multiverse restricted universe
deb-src precise-security main multiverse restricted universe
deb precise-proposed main multiverse restricted universe
deb-src precise-proposed main multiverse restricted universe
阅读(1523) | 评论(0) | 转发(1) |