- Reference Document Http://www.howtoforge.com/local_debian_ubuntu_mirror
- Installation Services:
sudo
apt-get
install
apt-mirror apache2
- Configuration Apt-mirror (/etc/apt/mirror.list)
############# Config ###################Setbase_path/mnt/raid5/apt-mirror############# config ################## #修改默认路径Setbase_path/mnt/raid5/apt-MirrorSetMirror_path $base _path/MirrorSetSkel_path $base _path/SkelSetVar_path $base _path/varSetCleanscript $var _path/clean.shSetDefaultarch AMD64 #<running Host architecture>SetPostmirror_script $var _path/postmirror.shSetRun_postmirror0SetNthreads -Set_tilde0############## end config ############## #Ubuntu12.04ltsdeb http://mirrors.163.com/ubuntu precise main restricted universe multiverseDeb http://mirrors.163.com/ubuntu precise-security main restricted universe multiverseDeb http://mirrors.163.com/ubuntu precise-updates main restricted universe multiverse#deb http://mirrors.163.com/ubuntu precise-proposed main restricted universe multiverse#deb http://mirrors.163.com/ubuntu precise-backports main restricted universe multiverse#Ubuntu14.04ltsdeb http://mirrors.163.com/ubuntu trusty main restricted universe multiverseDeb http://mirrors.163.com/ubuntu trusty-security main restricted universe multiverseDeb http://mirrors.163.com/ubuntu trusty-updates main restricted universe multiverse#没有同步源代码 #deb-SRC http://mirrors.163.com/ubuntu precise main restricted universe multiverse#deb-src http://mirrors.163.com/ubuntu precise-security main restricted universe multiverse#deb-src http://mirrors.163.com/ubuntu precise-updates main restricted universe multiverse#deb-src http://mirrors.163.com/ubuntu precise-proposed main restricted universe multiverse#deb-src http://mirrors.163.com/ubuntu precise-backports main restricted universe multiverseClean http://Mirrors.163.com/ubuntu
- Create a local warehouse: Su-apt-mirror-c apt-mirror #切换为root用户, otherwise you will need to create a password for apt-mirror (206 is mirror)
- Clean up the local repository: sudo/bin/bash/mnt/raid5/apt-mirror/var/clean.sh
- Configure automatic synchronization of local sources: sudo vim/etc/cron.d/apt-mirror #打开注释掉的最后一行
- Allow local repositories to access via http: sudo ln-sf/mnt/raid5/apt-mirror/mirror/mirrors.163.com/ubuntu//var/www/ubuntu
Configuring the client source (on the PC)
Cd/etc/apt
sudo rm sources.list.d/* apt.conf.d/*-RF
sudo cp Sources.list{,.bak}
#用下面三行替换掉sources. Everything in the list
Deb [ARCH=AMD64] http://10.0.0.206/ubuntu/precise main restricted universe multiverse
Deb [ARCH=AMD64] http://10.0.0.206/ubuntu/precise-updates main restricted universe multiverse
Deb [ARCH=AMD64] http://10.0.0.206/ubuntu/precise-security main restricted universe multiverse
- Try local source
sudo apt-get update
Create a local Ubuntu image