New Zealand sources.list for apt(8) on Debian and Ubuntu

apt's behaviour is moulded by files in /etc/apt: apt.conf(5) tells apt how to behave, and (more importantly) sources.list(5) tells apt where to look for packages. There are two types of entries in this file, deb lines, referring to Debian binary package repositories, and deb-src lines, for source packages. Unless you want to compile packages yourself from Debian sources, you can usually remove the deb-src lines from your config and save some time downloading headers.

If you're running a production server, or don't need bleeding edge, your lines should read

deb [mirror] stable main contrib non-free

The more exciting new stuff is in testing or unstable; see FlavoursOfDebian for more information on how this works.


This is a file set up for a New Zealand user, using the stable distribtion. If you want to use testing or unstable, just change mentions of 'stable' to the flavor of your choice. If you have bandwidth to burn, enable more than one mirror at once (Packages.gz tends to be around 2mb.)

NOTE: if you use 'stable', when a new stable release happens, apt-get will start giving you new versions of packages, which could do all sorts of things. It pays to use the name of the distribution, ie 'sarge', in this case.

There are plenty of other Apt mirrors around the world; try http://www.your two letter country

# WLUG sources.list for Debian.  See
# for an up to date version.  See sources.list(5) for more information.
# Remember that you can only use http, ftp or file URIs -
# CDROMs are managed through the apt-cdrom tool.
# remember!  stable == sarge.  testing == etch.  unstable == sid (always).
#            non-us was removed as of the sarge release.
# If you are going to use stable, make sure security is enabled also.

# Main NZ mirror: Citylink (national traffic if your [ISP] peers at [APE] or [WIX], international otherwise)
deb stable main contrib non-free
deb stable/non-US main contrib non-free

# Security.  Have this enabled, always.  It's also best to use the official international
# mirror, which is an anycast address to your closest official mirror.
deb stable/updates main contrib non-free

# Volatile.  Have this enabled to get things which are obsolete in stable, such as clamav.
# Read before using this.

deb sarge/volatile main contrib non-free
#deb sarge/volatile main contrib non-free

# Uncomment if you want the apt-get source function to work
#deb-src stable main contrib non-free

# ---
# Below this point are unofficial mirrors, which you might like to use if you are closer to them.

# Uncomment to use Callplus's mirror
# deb stable main contrib non-free

# Uncomment to use, hosted at Orcon:
# deb stable main contrib non-free

# Uncomment to use Inspire's mirror:
# deb stable main contrib non-free

# Uncomment to use IHUG's mirror:
# deb stable main contrib non-free

# Uncomment to use Paradise's mirror:
# deb stable main contrib non-free

# Uncomment to use AARnet in Australia
# deb stable main contrib non-free

# Uncomment to use the "main" American source
# deb stable main contrib non-free

Pinning your distribution

If you want to use packages from several distributions at once, see AptNotes for details on pinning packages.

Playing multimedia

To use MP3s or DVDs under Debian add the following line to your sources.list

deb sarge main

NB This might not be legal in your country.

Also, see if you want this for other versions of Debian or other processor architecutres than i386.

Ubuntu APT

Synaptic does a very nice job of managing your ubuntu sources list. You can add the universe and multiverse repositories with a few mouseclicks, and even add non-standard repositories without leaving the GUI.

The following URLs give you access to all of the officially supported packages in Ubuntu from the New Zealand mirrors.

nz2 and nz appear to be in different network locations, and depending on whether your ISP has a sensible peering policy, one or other may offer much better bandwidth.

Easyubuntu and automatix scripts have an option to update your sources.list too. Use this option with caution because it quite often screws up.

There's also Source-O-Matic which will build you a sources list using the official, and some of the better-known unofficial repositories. This has always worked very well for me, and is a quick and easy way to get back to a working config if you let easyubuntu or automatix break it :-)