Howto: Create your own Debian or Ubuntu package repository

The Debian package management system (called Advanced Packaging Tool or APT) is by far the most well-designed and is one of the top killer features on the Linux platform.

This short Howto describes howto establish a Debian package repository for home-grown deb-packages or like (could be used for Ubuntu as well, since Ubuntu uses the Debian package management system).

Establish repository structure
Create the repository structure in a directory. E.g. in ~/public_html directory exposed to the web.


cd public_html
mkdir my-repository
cd my-repository
mkdir binary
mkdir source

Copy your deb-packages into the repository

Like this
cp src/bzr_0.11-1.1_all.deb public_html/my-repository/binary/

Install the tools to be able to create a repository index

sudo aptitude install dpkg-dev

Create a repository index
cd my-repository
dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz

Using the repository


# Add these two lines into the /etc/apt/sources.list
deb http://mediakey.dk/~cc/my-repository binary/
deb-src http://mediakey.dk/~cc/my-repository source/

Feel free to comment – easier methods and tips are more than welcome ;)

For a more professional package management setup, use reprepro

Related posts:

  1. Howto duplicate a debian setup
  2. Howto: Write Debian Package Descriptions
  3. Ubuntu Howto: Install Oracle
  4. Howto Install Oracle on Debian
  5. How package management changed everything
  6. Howto create a subversion(svn) file based repository
  7. Howto install Sun Java on Debian Sarge
  8. Howto: Install Ruby and Rails on Debian or Ubuntu
  9. Howto Install Sun Java on Debian Etch
  10. Ubuntu and Ruby

Popular Related Items »

5 Comments

  1. miksuh said,

    January 9, 2008 @ 2:03

    Looks like you are forgetting Secure Apt. You really should create repository key and signed release-file too. Read lthis Debian wiki page:.

    http://wiki.debian.org/SecureApt

  2. danny said,

    May 11, 2008 @ 1:01

    how to create a repository

    do not lose what you already downloaded just read this tutorial
    http://tips-debian.blogspot.com/2008/04/make-repository.html

  3. IT Administrators » My Own Aptitiude Repos said,

    October 19, 2008 @ 0:56

    [...] http://mediakey.dk/~cc/howto-create-your-own-debian-or-ubuntu-package-repository/ [...]

  4. My Own Aptitiude Repos : Mike Schoon said,

    February 13, 2009 @ 20:35

    [...] http://mediakey.dk/~cc/howto-create-your-own-debian-or-ubuntu-package-repository/ [...]

  5. flirc blog» Blog Archive » Great Find to help with development said,

    April 25, 2009 @ 21:56

    [...] Hosting your own repository [...]

RSS feed for comments on this post