Creating A Local Mirror For Linux Mint 13

If your like me and either have to administer or install many linux mint 13 installs with a slow internet connection you can benefit from having a local repository mirror. This will keep all bandwidth on your local LAN and keep yout internet pip free for other things


Below is how to create a mirror for linux mint long term support version 13. I have shown how to mirror all the repositories needed except the updates. Doing a local repository for updates I find hard to keep up to date and for how much data you will draw from it, its not worth the headache


Install Required Software



Make A Folder To Keep Your Repo

I'll be using /repo for my purposes but replace it with whatever you want



Edit Apt-Mirrors Configuration File



Change...



To..



Change...



To...(So the mirroring process doesnt hog your whole internet connection)



And at the bottom of the file add in the following entries



Start The Mirroring Process

The following command will download all files from the repository servers. This will take some time and will take approximately 125GB of space, so make sure you have the room and a large cup of coffee



Configure Apache

Once everything has downloaded we can go ahead and finish setting up apache to serve up the files



Some systems have modsecurity enabled by default, in which case you should add the following to the bottom of the file /etc/modsecurity/modsecurity_crs_10_setup.conf



Keeping Your Repository Up To Date

Files change in the master repository all the time, to make sure your local repository keeps up with the changes theres a crontab entry to keep everything updated once a day



Look for the following line in the file and remove the "#" from the start of the line



Cleaning Up Your Repository

Cleaning up your repository from now and then will help save space but this has to be run manually



Switching Your Clients To Use Local Repository

Now you have your repository all set up you switch all your clients over to using it. On each client to use the new local repository server do the following:



For each entry in the file You need to change the primary domain name to your local repository IP address / domain name. Until you know everything is working its best to copy each line and comment one of them out using "#" at the start of the line. That way its easy to revert back to your origional configuration.


For example my origional configuration was....



Now my configuration is....replace X.X.X.X with your server IP / Domain Name



Update Your Repository List

The only other step is to run an update which will get the file listings from your server. If your run into any issues double check you have followed the steps above correctly.