Using a local APT Repository for your Student VM

Watch out! This tutorial is over 2 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.
Tutorial Difficulty Level    

Advanced Package Tool, or APT, is a free software user interface that works with core libraries to handle the installation and removal of software on Debian, Ubuntu and other Linux distributions. APT simplifies the process of managing software on Unix-like computer systems by automating the retrieval, configuration and installation of software packages, either from precompiled files or by compiling source code.

Say you wanted to install postfix, normally you would first run

which updates the local package lists for upgrades to packages (that need upgrading), as well as new packages that have just come to the repositories. Now when you run

your server knows what the latest version is and where to pull it from (usually at your nearest archive mirror). Our Ubuntu packages usually come from HEAnet’s mirror in Dublin, which is really fast. But what is this is really busy, or even down?! Surely a mirror inside DkIT would be better still? Well, now we have one (internal only). And here are the changes to make to your Ubuntu 16.04 or Ubuntu 18.04 Virtual Server (or REAL machine) repository list, found at /etc/apt/sources.list on both distro versions (note that the Ubuntu 16.04 Quick Instance and Ubuntu 18.04 Quick Instance have been modified to use this going forward).

Here is the new file contents on 16.04:

and on 18.04:

Be sure to run

afterwards, and even run

which will get all available updates for your current setup.

For the moment we are only supporting Ubuntu LTS releases still inside the 3 year support window. The  repo mirror also has files for the current Debian stable release, but if you are a Debian user you likely don’t need an explanation of what to do! The config is even simpler than Ubuntu:

Restoring Original Configuration

Should you find you ever need to put back the original contents of sources.list, the below will suffice.

For Ubuntu 18.04:

and for the earlier Ubuntu 16:04: