Monday, August 3, 2009

APT HOWTO - Basic Configuration

APT HOWTO - Basic Configuration: "2.2 How to use APT locally

Sometimes you have lots of packages .deb that you would like to use APT to install so that the dependencies would be automaticaly solved.

To do that create a directory and put the .debs you want to index in it . For example:

mkdir /root/debs

So, inside the directory /root, create an empty file, with any name. That is because an APT repository needs a file known as 'override', it may be empty, but it has to exist. One may use the following command to create this file:

touch file

Inside this file you may want to define some options to override the ones the ones that come with the package. It looks like follows:

package priority section

package is the name of the package, priority is low, medium or high and section is the section to which it belongs. It is enough to leave the file empty/

Still in the /root directory do:

dpkg-scanpackages debs file | gzip > debs/Packages.gz

In the above line, file is the 'override' file, the command generates a file debs/Packages.gz that contains various informations about the packages, which are used by APT. To use the packages, finally, add:

deb file:/root debs/

After that just use the APT commands as usual. You may also generate a sources repository. To do that use the same procedure, but remember that you need to have the files .orig.tar.gz, .dsc and .diff.gz in the directory and you have to use Sources.gz instead of Packages.gz. The program used is also different. It is the dpkg-scansources. The command line will look like this:

dpkg-scansources debs | gzip > debs/Sources.gz

Notice that dpkg-scansources doesn't need an 'override' file. The sources.list's line is:

deb-src file:/root debs/"

No comments:

Post a Comment