Create and use a local UbuntuSource backup storage

Source: Internet
Author: User
Why do I need to create a Ubuntu local image? There are only a few commonly used software packages in the Ubuntu release CD. The software to be installed on Ubuntu often needs to be downloaded from the Ubuntu source server. Use the following command to search for and install available software packages. Apt-cachesearchpackageNamesudoapt-getinstallpackageNameapt-get actually uses the wget command from/etc/apt/sources.

Why do I need to create a local Ubuntu image?

There are only a few commonly used software packages in the Ubuntu release CD. The software to be installed on Ubuntu often needs to be downloaded from the Ubuntu source server.

Use the following command to search for and install available software packages.

Apt-cache search packageName

Sudo apt-get install packageName

Apt-get actually uses the wget command to download the corresponding. deb package from the source specified in the/etc/apt/sources. list configuration file, and then install the software using dpkg-I packageName. deb.

If the environment where the Ubuntu computer is located has poor network performance or cannot connect to the Internet, it is difficult to install a large number of software packages on the Ubuntu Source server.

In this case, you can create your own Ubuntu Source server in the LAN to save a lot of network traffic and greatly increase the speed of software installation!

This article describes how to create a local image of Ubuntu Source.

Create a local Ubuntu Image

Requirement

To create a ubuntu mirror server, you need at least 60 GB of hard disk space. Each Ubuntu version is divided into two versions: 32bit and 64bit. There are two groups of deb packages. The latest ubuntu version requires about 90 GB space for the two deb packages.

You can create a 32-bit or 64-bit server of ubuntu or a server serving both 32-bit and 64-bit. You can also create source servers for all ubuntu versions. Depends on the space remaining on your hard disk and your needs.

Use sohu's Ubuntu Source server as the Source server

Sohu provides a variety of source servers for Linux and BSD operating systems. Click the link below

Http://mirrors.sohu.com/

We can see all types of source servers provided by sohu.

Click the http://mirrors.sohu.com/help/ubuntu.html page to see the Ubuntu Source server help.

You can directly modify/etc/apt/sources. list file, add the sohu source server to use the sohu source server, which is much faster than the international official ubuntu source server.

Next, I will build a local Ubuntu Source server based on sohu's Ubuntu Source server.

Why I chose sohu's Ubuntu Source server as the source for replication:

1. sohu's Ubuntu Source server is quite fast. If I use the official ubuntu source server as the copy source, it will obviously take more time.

2. sohu's Ubuntu Source server synchronizes with the official ubuntu source server every day. Therefore, we can ensure that I can use the latest deb package on www.linuxidc.com.

The Ubuntu Source server I built will also be synchronized with sohu's Ubuntu Source server once a day.

Use apt-mirror to create a local backup storage for the Ubuntu Source server

Sudo apt-get install apt-mirror

Sudo apt-get install apache2

We need the above two software to build our local Ubuntu Source server.

I will introduce how to build the local ubunt source server of ubuntu10.10 and ubuntu10.04 in 32-bit and 64-bit versions.

If you want to serve other versions, modify the corresponding configuration.

The/etc/apt/mirror. list configuration file is changed to the following:

############# 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

# Set postmir_script $ var_path/postmirror. sh

# Set run_postmirror 0

Set nthreads 20

Set _ tilde 0

#

############ End config ##############

Deb http://mirrors.sohu.com/ubuntu lucid main/debian-installer restricted/debian-installer universe multiverse

Deb http://mirrors.sohu.com/ubuntu maverick main/debian-installer restricted/debian-installer universe multiverse

Deb http://mirrors.sohu.com/ubuntu lucid-security main restricted universe multiverse

Deb http://mirrors.sohu.com/ubuntu maverick-security main restricted universe multiverse

Deb http://mirrors.sohu.com/ubuntu lucid-updates main restricted universe multiverse

Deb http://mirrors.sohu.com/ubuntu maverick-updates main restricted universe multiverse

# Deb http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse

# Deb http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse

The deb-src http://mirrors.sohu.com/ubuntu lucid main restricted universe multiverse

Deb-src http://mirrors.sohu.com/ubuntu maverick main restricted universe multiverse

The deb-src http://mirrors.sohu.com/ubuntu lucid-security main restricted universe multiverse

Deb-src http://mirrors.sohu.com/ubuntu maverick-security main restricted universe multiverse

The deb-src http://mirrors.sohu.com/ubuntu lucid-updates main restricted universe multiverse

Deb-src http://mirrors.sohu.com/ubuntu maverick-updates main restricted universe multiverse

# Deb-src http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse

# Deb-src http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse

Deb-i386 http://mirrors.sohu.com/ubuntu lucid main/debian-installer restricted/debian-installer universe multiverse

Deb-i386 http://mirrors.sohu.com/ubuntu maverick main/debian-installer restricted/debian-installer universe multiverse

Deb-i386 http://mirrors.sohu.com/ubuntu lucid-security main restricted universe multiverse

Deb-i386 http://mirrors.sohu.com/ubuntu maverick-security main restricted universe multiverse

Deb-i386 http://mirrors.sohu.com/ubuntu lucid-updates main restricted universe multiverse

Deb-i386 http://mirrors.sohu.com/ubuntu maverick-updates main restricted universe multiverse

# Deb http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse

# Deb http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse

# Deb-src http://mirrors.sohu.com/ubuntu lucid main restricted universe multiverse

# Deb-src http://mirrors.sohu.com/ubuntu maverick main restricted universe multiverse

Note:

Maverick and lucid are codes of Ubuntu 10.10 and 10.04 respectively.

Deb http: // * Indicates downloading the 64-bit deb software.

Deb-i386 http: // * Indicates downloading the 32-bit deb software.

Run sudo apt-mirror.

This starts 20 threads [configuration in the above file] To Run wget to download the corresponding deb package under the http://mirrors.sohu.com/ubuntu.

After sudo apt-mirror is executed, all the required deb packages and corresponding configuration files are available in the/var/spool/apt-mirror directory.

Because I downloaded the file from sohu, the actual file is in the/var/spool/apt-mirror/mirrors.sohu.com/ubuntu directory.

If you select another Ubuntu Source service area, it will be downloaded to another directory.

Related Article

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.