Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Good day. I'm trying to create local copy of official Ubuntu repository(12.10 or 13.10 does not matter). As far as i know i could recursively download all packages from the mirror (http://mirror.yandex.ru/) but there is any othe way to do the job? Thank you.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Easiest way to copy everything is to use rsync :

 rsync -a --bwlimit=128 rsync://archive.ubuntu.com/ubuntu /media/mirror/ubuntu

Here's more info on the matter : https://help.ubuntu.com/community/Rsyncmirror

Rsync is a great tool.

EDIT to add it as your default repository to your hosts :

Publish the mirror on the Apache server This is the easy part. Assuming that you have Apache configured to follow symbolic links, all you need to do is add a symbolic link to your mirror!

 cd /var/www/
 ln /media/mirror/ubuntu -s

You can test to see if this was successful by using a web browser to visit the site. Goto ubuntumirror.mydomain/ubuntu

You should see some directories named "dists", "indices", "pool", "project", and a file named "ls-lR.gz".

Update Your Clients Now that you have your very own Ubuntu Mirror, you need to point all of your workstations and servers to this mirror for their updates. This mirror will be good for main, universe, multi-verse, and restricted.

Replace the server name for the Ubuntu Archives with your local mirror. The existing server will likely be something like us.ubuntu.com

If your server is called ubuntumirror.mydomain then your /etc/apt/sources.list file should look something like this

 deb http://ubuntumirror.mydomain/ubuntu/ feisty main restricted
 deb-src http://ubuntumirror.mydomain/ubuntu/ feisty main restricted

 deb http://ubuntumirror.mydomain/ubuntu/ feisty-updates main restricted
 deb-src http://ubuntumirror.mydomain/ubuntu/ feisty-updates main restricted

You can test your mirror by running

 # apt-get update

You should see some output referencing your server, similar to this:

 Get:1 http://ubuntumirror.mydomain feisty Release.gpg [191B]
 Ign http://ubuntumirror.mydomain feisty/main Translation-en_US
 Ign http://ubuntumirror.mydomain feisty/restricted Translation-en_US
 Get:2 http://ubuntumirror.mydomain feisty-updates Release.gpg [191B]
 Ign http://ubuntumirror.mydomain feisty-updates/main Translation-en_US
 Ign http://ubuntumirror.mydomain feisty-updates/restricted Translation-en_US
share|improve this answer
    
but how to setup my own server as repository? –  Zagorulkin Dmitry Dec 19 '13 at 17:23
    
At the end of the link. –  Genesis Dec 20 '13 at 11:28
    
thank you very much! –  Zagorulkin Dmitry Dec 20 '13 at 11:32
    
You're welcome :) –  Genesis Dec 20 '13 at 11:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.