Create a local Ubuntu image

Source: Internet
Author: User

    • Reference Document Http://www.howtoforge.com/local_debian_ubuntu_mirror
    • Installation Services: sudo apt-get installapt-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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.