Setting up your own simple debian repository

April 27th, 2009

In the process of getting a debian repostiry ready to allow easy installtion with debian’s apt, a small series of posts are going to be created here. So here is the initial post describing a very simple debian repository layout.

All that’s required to setup your own debian repository is the dpkg-dev package and a web or ftp server for serving the files. For a local deployement (e.g. within a company) also a file-system based approch is possible through a NFS mounted directory.

Make sure the dpkg-dev package is installed:

sh# aptitude install dpkg-dev

Copy all files into a directory binary on the server. So the layout will look something like this:

(webserver-root)
+-- debian
    +-- binary
    |   +-- myweb-2.0-1_i386.deb
    |   +-- myweb-utils-2.0-1_i386.deb
    +-- source

Here the packages in the binary directory can new be used to create the repository index and serve this then as a debian repository. To scan the packages and create the index use:

$ cd webserver-root
$ dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
$ dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz

Now the repository can be used by adding the following to /etc/apt/sources.list:

deb http://my.server.com/debian/binary ./
deb-src http://my.server.com/debian/source ./

See http://www.debian.org/doc/manuals/repository-howto/repository-howto for more details.

One Response to “Setting up your own simple debian repository”

  1. Kushal Koolwalon 31 Jul 2009 at 20:10

    HI,

    Do you know if the debian package dependencies will be handled by this method?

primary