How to create a Debian/Ubuntu repository

Create the repository directory with a conf dir inside:
Configure your favourite webserver to publish this repository dir and all its content

$ mkdir -p repo/conf
$ cd repo

Create the file conf/distributions and edit its content:

$ vi conf/distributions
Architectures: i386 amd64 source
Codename: stable
Components: main
Description: Repo description
Label: Ubuntu
Origin: MyOrigin
Version: 12.10

Create the file conf/options and edit its content:

$ vi conf/options
basedir .

Check if the repo is working:

$ reprepro  check
Checking stable...

Create a key with name repokey:

$ gpg --gen--key
$ gpg --export repokey > repokey.gpg

Sign the debian packages with the new key:

$ dpkg-sig --sign repokey ~/packages/*.deb

Copy them to the stable repository:

$ reprepro includedeb stable ~/packages/*.deb

We can see that the repository has the desired packages by writing:

$ reprepro list stable

And that it’s all.
You have finished your new repository.

If you want to remove a package from the stable repository:

$ reprepro remove stable 

If you want to remove all the packages from the stable repository

$ reprepro removefilter precise 'Section'