Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Configure Apt To Use Your Local Ubuntu Mirror

A local mirror isn't much good unless your computers are configured to use it. Replace the contents of your /etc/apt/sources.list file with the relevant section based on which version of Ubuntu you are using.:

It looks like apt-mirror is no longer being maintained and will not work with Ubuntu 20.04. I would recommend creating a mirror through rsync instead.

20.04 Bionic Beaver Users

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ focal main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ focal-security main restricted universe multiverse

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ focal-updates main restricted universe multiverse
deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ focal-backports main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ focal-proposed main restricted universe multiverse

18.04 Bionic Beaver Users

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ bionic main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ bionic-security main restricted universe multiverse

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ bionic-updates main restricted universe multiverse
deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ bionic-backports main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ bionic-proposed main restricted universe multiverse

16.04 Xenial Users

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ xenial main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ xenial-security main restricted universe multiverse

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ xenial-updates main restricted universe multiverse
deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ xenial-backports main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ xenial-proposed main restricted universe multiverse

14.04 Trusty Users

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ trusty main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ trusty-security main restricted universe multiverse

deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ trusty-updates main restricted universe multiverse
deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ trusty-backports main restricted universe multiverse
#deb http://MY-MIRROR-IP-OR-DOMAIN/ubuntu/ trusty-proposed main restricted universe multiverse

Uncomment the "proposed" one if you want to, but you will need to have had updated your mirrors /etc/apt/mirror.list config file.

You will need deb [arch=amd64] http://xxx if you did not ensure that you downloaded the i386 packages on the mirror.

Last updated: 17th April 2021
First published: 16th August 2018

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch