Quick guide to setting up a Debian apt repository

This is my quick guide to setting up a Debian apt repository:

  1. Install the needed software

    apt-get install apt-utils

  2. Create the directory structure under the webroot

    mkdir -p /var/www/apt/sarge

  3. Add the created .deb files to the archive

    cp mypackage-1.0.deb /var/www/apt/sarge

  4. Update the package list to reflect the new package.

    cd /var/www/apt
    apt-ftparchive packages sarge > sarge/Packages
     
  5. Gzip the package list to save space and bandwidth

    gzip -f sarge/Packages

  6. Update the Release file to reflect the new package

    apt-ftparchive release sarge > sarge/Release

Now you can add the apt line on your client’s /etc/apt/sources.list and apt-get update to see your freshly minted package.

## Maps to http://apt.www.freelancingdigest.com/debian/sarge/Packages.gz
deb http://apt.www.freelancingdigest.com/debian/ sarge/

Eric Davis

One comment

Comments are closed.