Ubuntu: what is repository mirror in Debian and ubuntu?


What is a local mirror of a debian apt repository? any simple explanation. Is it the same as ubuntu repository? what is the best way to create one? and is it mandatory to keep the same folder hierarchy as the original repository? or there is a way to configure that change?


when not to mirror

Before even bothering to start mirroring a whole repository, you should be aware of this:

  • In case you're just trying to save bandwidth with multiple similar clients. Instead:

    Best way to cache apt downloads on a LAN?

  • In case you are setting up a public mirror, but the software license restricts you to do so. Not all third party software allows you to redistribute their software, such as Oracle Java. (not the best example, as they don't even offer a Debian repository)

  • If you're just interested in a small selection of the packages. Instead, just download the .deb files and then follow:

    How to set up a Debian Repository?

the what

any simple explanation.

I hope you mean simple as in simple wording, rather than short/compact.

What is a local mirror of a debian apt repository?

Let's zoom out a bit, first. Debian and Ubuntu are very common Operating Systems, specifically, Ubuntu is derived from a Debian base. One of the key features of Debian and therefore also Ubuntu, is the package management. Repositories are a set of packages published in a certain way that the package management can easily understand the package list and verify the integrity of all of it. Repositories are copied all over the world for more efficient use of bandwidth as well as to have a higher availability. This continuous copying (or synchronisation) is also called mirroring.

Now, zooming back in on your question. You can do this mirroring operation yourself as well. This will pull in tens of Gigabytes of data just for the main repositories, but once copied, you'll have them local, at LAN speed! This is useful for deploying a big amount of machines and you don't want to rely on the internet for some reason (bandwidth, availability, etc.). You can mirror from a local mirror near you or pick one that has a lower delay.

Is it the same as ubuntu repository?

If one refers to a Debian APT repository, this is ambiguous for either a repository for...

  • the Debian OS, containing all Debian packages.
  • the use with APT, possibly providing packages for other APT-based distributions.

The format of the repositories is the same, speaking in terms of simple ones. Debian has some differences for differential updating package lists for example, but it doesn't mean it's incompatible.

is it mandatory to keep the same folder hierarchy as the original repository?

If you do a simple mirror, you can pick another sublevel, e.g. http://host.domain.tld/my-mirrors/ubuntu-archive/ubuntu, but you'll have to adhere to the format of the repository. You can't just shuffle around .debs there, as there are cross-references in there.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »