1

I want to make two things:

First of all, I want to have my own repository of ubuntu in my servers to not overload the usage of Internet in my company and to control the updates. I think that I have to use apt-mirror

And also I want to add my own packages to the repository.

What is the best way to do this?

Do I have to have two repositories? One with the mirror and another one with my packages? In case of conflict with my packages how Ubuntu solve this?

Thank you

xabim
  • 213
  • 2
  • 3
  • 10

2 Answers2

4

I had to do something very similar for my AWS based setup. I decided to have one box with aptcacher-ng and dpkg-dev package.

reprepro doesn't support multiple versions of a package so I didnt use it. Since I wanted to keep these boxes as ephemeral as possible with low setup time I did not use apt-mirroring as it can download lot of data depending what you want it to mirror.

Aptcacher-ng caches the packages and this box is contacted by all other boxes for their apt needs so I end up saving lot of time and bandwidth.

APZ
  • 954
  • 2
  • 12
  • 24
1

Yes, you'll want to use two separate repos if you do it this way - the mirror will stay signed by the GPG keys of the distribution, while your repo with custom packages will be signed by a GPG key you generate (and your nodes will need to trust).

An alternative to mirroring is apt-cacher-ng - it's configured as an apt proxy on your nodes, and will handle all package requests. On the first request for a given package, it will download a package from the upstream internet repo; on subsequent requests, it will serve that package from cache. So you get the bandwidth savings of a local mirror without having to keep a copy of the entire repo (80% if which you'll never use).

For your internal repo of custom packages, use reprepro - it'll handle all the file structure and signing, you'll just need to deal with setting up the GPG key and feeding it .deb files.

For package conflicts, the client systems will determine which to use - generally, this is done by comparing the version string on the two different packages, but can also be affected by pinning.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248