Ubuntu14 Adding a local mirror source

Source: Internet
Author: User

Overview

Said the CentOS Epel source to build the way, in the next Ubuntu image source and OpenStack Local source construction.


Steps

1. Installing Apt-mirror

#apt-get Install Apt-mirror

2. Manually create the/apt/ubuntu directory and modify the/etc/apt/mirror.list to add the following:

############# config #################### set base_path    /var/spool/ apt-mirror  set base_path    /apt/ubuntu# set mirror_path    $base _path/mirror# set skel_path     $base _path/skel# set var_ path      $base _path/var# set cleanscript  $var _path/clean.# set  defaultarch  <running host architecture># set postmirror_script   $var _path/postmirror.shset run_postmirror 0  set nthreads      20  set _tilde 0 deb http://mirrors.163.com/ubuntu/ trusty  main restricted deb http://mirrors.163.com/ubuntu/ trusty-updates main  restricted deb http://mirrors.163.com/ubuntu/ trusty universe deb http:// Mirrors.163.com/ubuntu/ trusty-updates universe deb http://mirrors.163.com/ubuntu/ trusty multiverse deb http:// mirrors.163.com/ubuntu/ trusty-updates multiverse deb http://mirrors.163.com/ubuntu/  trusty-backports main restricted universe multiverse deb http://mirrors.163.com/ ubuntu/ trusty-security main restricted deb http://mirrors.163.com/ubuntu/  trusty-security universe deb http://mirrors.163.com/ubuntu/ trusty-security  multiverse deb http://extras.ubuntu.com/ubuntu trusty main clean http:// mirrors.163.com/ubuntu/  deb http://ubuntu-cloud.archive.canonical.com/ubuntu  Trusty-updates/liberty main

3. Execute apt-mirror and start downloading and synchronizing the package

#apt-miiror

4. Install Apache and attach the background source to the Apache www root directory

#apt-miiror #apt-get install apache2 #cd/var/www/html/#ln-S/apt/ubuntu/mirror/mirrors.163.com/ubuntu #ln-S/apt/ubu Ntu/mirror/ubuntu-cloud.archive.canonical.com/ubuntu OpenStack

Ensure access to directory content through Http://x.x.x.x/ubuntu or http://x.x.x.x/openstack

5. Synchronize sources regularly by scheduling tasks

#Crontab-E 0 * * */usr/bin/apt-mirror >/var/spool/apt-mirror/var/cron.log

6. Configure the client source, edit/etc/apt/source.list, delete other content, add:

Deb Http://10.0.0.100/ubuntu/trusty main restricted deb http://10.0.0.100/ubuntu/trusty-updates main restricted Deb Htt P://10.0.0.100/ubuntu/trusty Universe Deb Http://10.0.0.100/ubuntu/trusty-updates universe Deb Http://10.0.0.100/ Ubuntu/trusty Multiverse Deb Http://10.0.0.100/ubuntu/trusty-updates Multiverse Deb http://10.0.0.100/ubuntu/ Trusty-backports main restricted Universe Multiverse Deb Http://10.0.0.100/ubuntu/trusty-security main restricted Deb HT Tp://10.0.0.100/ubuntu/trusty-security Universe Deb http://10.0.0.100/ubuntu/trusty-security Multiverse Deb/http 10.0.0.100/openstack/trusty-updates/liberty Main

Client Update:

#apt-get Update


Ubuntu14 Adding a local mirror source

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.