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

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.