Use apt-mirror to create a Debian source Image

Source: Internet
Author: User

The apt-mirror tool can download the official image to a local device and ensure that the directory structure is consistent with that of the image. However, you cannot modify the image repository. To download and modify the image repository, use the reprepro tool.
 
[Installation]
First install apt-mirror
Sudo apt-get install apt-mirror
 
After installation, you can use man apt-mirror to view the tool documentation. It is important to introduce some files and directories, for example:
/Etc/apt/mirror. list: Master configuration file
/Etc/cron. d/apt-mirror: configuration file automatically executed by cron at regular intervals
/Var/spool/apt-mirror/mirror: Default storage location of mirror
 
/Var/spool/apt-mirror/var: location where log files and scripts are stored.

[Configuration]
Modify the/etc/apt/mirror. list configuration file. The meaning of the configuration item is very simple and clear. The modification content is as follows:
############# Config ##################
#
# Set base_path/var/spool/apt-mirror
#
# Set pai_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 postmir_script $ var_path/postmirror. sh
# Set run_postmirror 0
Set nthreads 20
Set _ tilde 0
#
############ End config ##############
 

Deb http://packages.linuxmint.com olivia main upstream import
Deb http://archive.Ubuntu.com/ubuntu raring main restricted universe multiverse
Deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse
Deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse
Deb http://archive.canonical.com/ubuntu/ raring partner
 

Deb-src http://packages.linuxmint.com olivia main upstream import
Deb-src http://archive.ubuntu.com/ubuntu (raring main restricted universe multiverse)
Deb-src http://archive.ubuntu.com/ubuntu (raring-updates main restricted universe multiverse)
Deb-src http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse
Deb-src http://archive.canonical.com/ubuntu/ (raring partner)
 

This file is the configuration information for downloading the image. You can use the default configuration, and then add the official source address you want to download. The default 32-bit or 64-bit software package is the same as the user's operating system. However, you can add i386 after deb to specify 32-bit download, and add amd64 to specify 64-bit download. After the modification is complete, run the sudo apt-mirror command. This command starts 20 threads to download from the following source address. After the command is executed, the/var/spool/apt-mirror directory contains all the required deb packages, source code packages, and corresponding apt configuration files. When you need to synchronize updates with the official website, execute apt-mirror again to download the updates. You can also configure cron to automatically update it at regular intervals.
 

[Configure apache service]
 
After you use apt-mirror to download official sources, you need to provide network services for use. Because apache2 server is efficient and stable in serving static files, apache2 server is selected. After apache2 is installed, the/var/www/directory is used as the Web root directory by default, create a soft link in/var/spool/apt-mirror/xxxxxx to access the source mirror.

Recommended reading:

Debian 7.0 Wheezy test experience

Debian 7.0 Wheezy released!

Install Debian 7.0 Wheezy on a USB flash drive

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.