Create local copy of Ubuntu remote repository
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
Related videos on Youtube
Dmitry Zagorulkin
10gen Certified MongoDB developer SOreadytohelp
Updated on September 18, 2022Comments
-
Dmitry Zagorulkin over 1 year
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.
-
Dmitry Zagorulkin over 10 yearsbut how to setup my own server as repository?
-
olipinski over 10 yearsAt the end of the link.
-
user75798 over 9 yearsDoesn'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.