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.:

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

12.04 Precise Users

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

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

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

Uncomment the precise proposed 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.