Hello Friends of Linux! I'd like to share the experience of a mirror for the repository distro Ubuntu. Reasons you want to create a repository can be several: for example you have a malfunction, or (and) slow internet and you would like to keep the repository in their own hard drive, another option is to create a mirror inside the local network, is exactly what I have done and guidance will be for this option. So first we need to own the repository to download it to a hard drive, we need a program debmirror, can install it via your favorite package manager Adept or Synaptic, well, or through the console. Here I will give examples for the console, well, with graphics and you will understand. Install the program debmirror
sudo apt-get install debmirror
Now prepare a folder which will be downloaded to the repository
mkdir ubuntu
Of course you can name the folder whatever you like. Now we need to create a script in the folder itself, which actually will upload the repository.
gedit archive.ubuntulinux.org.sh
The script must contain the following lines
#! /bin/bash -x /usr/bin/debmirror --nosource -m --passive --host=archive.ubuntulinux.org \
--root=ubuntu --method=http --progress \
--dist=maverick,maverick-security,maverick-updates,maverick-backports \
--ignore-release-gpg --section=main,restricted,multiverse,universe \
--arch=i386 /path/to/your/repository/
This script will pump out the repository for version Ubuntu 8.04. I guess you all noticed parameter-arch this option specifies the architecture for which the assembled packages You can also set the value amd64. Well, now all execute script
./archive.ubuntulinux.org.sh
Please note that I have such a repository took about 22Gb (i386). The script can always be completed without any consequences, and after the next start of the script it will check all the md5 checksum of the package and will continue to work (keep in mind that checksumming is a significant resource of the processor, so that as the number of downloaded packages try to rarely interrupt the script) Well Now you have on your hard disk is a copy of the repository if you want to add it to the package sources you need to set a line similar to the following
deb file://blablabla/ubuntu/ru.archive.ubuntu.com/ hardy main restricted multiverse universe
Now, the actual creation of the mirror. So for a mirror, we need the WEB-server Apache. To install the Indian type in the terminal
sudo apt-get install apache2
Installed? Run and ... nothing. It still needs a little set up, do not be afraid of setting it quite a bit. Most of the settings are stored in the configuration file
/etc/apache2/apache2.conf
open it for editing
sudo gedit /etc/apache2/apache2.conf
We find in this file the lines with the parameters
User
and
Group
set the value of these parameters in the www-data. You should get the following
User www-data
Group www-data
Now you need to specify the Apache file names that it will be open by default when the browser address to your website. This step is optional, it will be necessary for us to verify that the server. Add the line
DirectoryIndex index.html index.phtml index.php
Now you can test your server by running the Apache web browser and typing in your IP address. I have added (just in case) the line
DocumentRoot "/var/www/"
Which points to the directory that contains the site. You can specify the directory where your repository. Or you can simply copy the contents of the repository in that folder. I've done a little differently, posted the repository on a separate partition and mount it in /var/www/ . All now delete the file index.html from the directory with the site again and type in the browser the address, there will be a repository. To add the repository to package sources you need to register in the file /etc/apt/sources.list like this
deb http://Your IP address/ru.archive.ubuntu.com/hardy main restricted multiverse universe
Discuss this and other issues related with software obepecheniem, go to the forum http://trambroid.com/forum/16