How to create a local slackware repository with dependency support

From Salix OS
Jump to: navigation, search

Salix provides a Slackware 14.0 repository with dependency support at the following mirrors for 32bit packages:

and these for 64bit packages:

This repository is not a real Slackware repository, as it doesn't actually contain any packages. It only holds dependency information for all packages included in the Slackware repositories. All package traffic is diverted to a Slackware mirror, specifically ftp.gwdg.de, and packages are actually downloaded from there. Although this Slackware mirror is fast for most people, it may not in fact be fast enough for you, depending mostly on where you live. This how-to shows you how to create such a local Slackware repository in your own PC and point it to any other Slackware mirror, one that will probably be faster for you and how to point slapt-get/gslapt to it.

As this is not really a Slackware mirror, since it will not include any Slackware packages, it doesn't take much space in your HD, only just a few KB.

Setting up the local repository

First thing you have to do, is pick where you want to hold the local repository, /path/to/repo will be used in this article from now on to point to that. So, create a /path/to/repo directory, download the adddepinfo.sh script from the Salix server and make it executable:

wget http://salix.enialis.net/i486/slackware-14.0/adddepinfo.sh
chmod +x adddepinfo.sh

You can edit the adddepinfo.sh script with your favorite text editor. There is a line with the following text close to the top:

SLACKREPO="http://ftp.gwdg.de/pub/linux/slackware/slackware-14.0/"

Change that to point to the Slackware repository you want to use, for example:

SLACKREPO="http://ftp.ntua.gr/pub/linux/slackware/slackware-14.0/"

Remember to use the appropriate repository for your architecture. Next, you'll need to download the dependency files in a deps directory located under /path/to/repo. Create that dir, cd into it and download all dep files with wget:

mkdir /path/to/repo/deps
cd /path/to/repo/deps
wget -m -nH -r -np --cut-dirs=4 -R "=D","=A","index.html" http://salix.enialis.net/i486/slackware-14.0/deps/

Now, cd back into the /path/to/repo directory and run the adddepinfo.sh script

cd /path/to/repo
./adddepinfo.sh

That will take a few minutes. After it finishes, the local repo is ready, complete with the patches and extra directories.

Pointing the package manager to the local repository

You now need to edit the slapt-getrc file to point to the local repository. Log in as the root user and edit the /etc/slapt-get/slapt-getrc file with your favorite text editor. You'll need to remove or comment out the two lines that refer to the Slackware repository in the Salix server and add the local directory instead (leave the actual Salix repository intact). The sources section of slapt-getrc should look something like this:

#SOURCE=http://salix.enialis.net/i486/slackware-14.0/
#SOURCE=http://salix.enialis.net/i486/slackware-14.0/extra/
SOURCE=file:///path/to/repo
SOURCE=file:///path/to/repo/extra
SOURCE=http://salix.enialis.net/i486/14.0/:PREFERRED

Finally, inform slapt-get about your changes:

 slapt-get -u

And you're ready to use slapt-get/gslapt to install slackware packages with dependency information from your favorite Slackware mirror.

Refreshing the repository information

Slackware repositories for stable versions normally don't change contents during their lifetime. The exception is of course the patches directory, which is updated with security and important bug fixes. If you want to update the local copy with those, you'll need to run the adddepinfo.sh script every now and then. Putting something like the following in a cronjob that will run once a day will take of everything:

cd /path/to/repo && ./adddepinfo.sh