How to build a local source for Ubuntu system

Source: Internet
Author: User
Tags web services


The company wants to start restricting all VMS directly to the extranet, so it needs to build a local source locally, before sharing a centos local source structure, and also today the Ubuntu is sorted out.

Installation of Apt-mirror Tools

# Apt-get Install Apt-mirror

Second, configure Apt-mirror

Because the source content is more, so it is best to separate a disk storage, I put in the/cache1/apt-soutce


# vim/etc/apt/mirror.list

############# Config ##################
#
Set Base_path/cache1/apt-source
#
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 40
Set _tilde 0
#
############# End Config ##############
######################################### #trusty ############################
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-backports main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-proposed main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-security main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-updates main restricted universe multiverse

deb-i386 http://mirrors.sohu.com/ubuntu/trusty main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-backports main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-proposed main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-security main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-updates main restricted universe multiverse

######################################### #precise ###########################
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-backports main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-proposed main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-security main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-updates main restricted universe multiverse

deb-i386 http://mirrors.sohu.com/ubuntu/precise main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-backports main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-proposed main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-security main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-updates main restricted universe multiverse

Third, configure timing synchronization


# Vim/etc/cron.d/apt-mirror

0 0 * * 0 apt-mirror/usr/bin/apt-mirror >/cache1/apt-source/var/cron.log

Four, start the synchronization

The synchronization process is either prompt or interrupted, and the next time you run Apt-mirror it will continue

# Apt-mirror
V. Build Web Services

I use the Nginx, choose according to my own preference.
Link Source to/var/www below


Cd/var/www

Ln-s/cache1/apt-source/mirror/mirrors.sohu.com/ubuntu Ubuntu

Vi. updating of local sources

The source is set to "Deb http://", the default is to sync 64-bit packets, if required 32-bit support needs to be changed to "deb-i386 http://"


# vim/etc/apt/sources.list

Deb Http://xx.xx.xx.xx/ubuntu precise main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-backports main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-proposed main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-updates main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-security main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-security main Multiverse restricted universe
Update apt database information after Setup is complete



Apt-get Update

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.