Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ( but there is any othe way to do the job? Thank you.

share|improve this question
up vote 1 down vote accepted

Easiest way to copy everything is to use rsync :

 rsync -a --bwlimit=128 rsync:// /media/mirror/ubuntu

Here's more info on the matter :

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

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
Doesn't your method back up every version of Ubuntu, including distant past ones? How do use rsync to backup selected areas of the repositories, such as only Trusty (and its updates), and/or only AMD64 archictecture? For example, all Lubuntu amd64 Trusty packages and updates. – user75798 Nov 17 '14 at 23:44

Your Answer


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.