I would like to use a local mirror of the Ubuntu repositories when I'm completing an Ubuntu Server installation. I have a mirror already created to serve the repository over the LAN using http, this works for updates/upgrades with machines using custom a /etc/apt/sources.list file.

How do I ensure that any package updates/upgrades which are used in a normal Ubuntu installation come from this source? I could complete the installation with the network cable unplugged, replace the sources file, and then upgrade the packages, but would rather do it all as part of the initial installation phase.

Ideally the answer will not involve building my own custom version of the installer, but if that's a necessary process feel free to describe it. As this is a server version installation, it's not possible to simply change the sources file in a live session.

  • 2
    If everything else fails you can modify /etc/apt/sources.list inside the installer image. It's a SquashFS so you'll need to extract it, modify stuff and then recreate a new one to replace the old one. – David Foerster Oct 2 '16 at 7:51

Maybe you should just install a (transparent) http proxy. I would suggest that you install a solution based on apt-cacher/apt-cacher-ng.

This way you only have to set the http_proxy environment variable while installing.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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