Create a custom repository

First you have to edit your configuration file and add a new repository.

<Repository custom-repo>
  local = custom-repo/custom/6/x86_64/
  type  = Yum

If you want to create an Apt repository instead the configuration looks a bit different.

# line in sources.list:
# deb http://your-server.corp/custom-repo/debian wheezy custom
<Repository custom-repo>
  local     = custom-repo/debian
  type      = Apt
  arch      = amd64
  dist      = wheezy
  component = custom

After adding your repository to the configuration file you can just initialize the new repository.

For the Yum repository type you need to have createrepo installed on your system. For Apt you need apt-ftparchive.

$ repositorio --repo=custom-repo --init

Now you can add files to your new repository with the add-file command:

$ repositorio --repo=custom-repo --add-file=my-custom-package-1.0.rpm

Signing repositories

If you want to sign your repositories, you have to create a gpg first. You can do this with the following command.

$ gpg --gen-key

After you have create your key, you need to get the key id.

$ gpg --list-secret-keys

You will see a line like this: sec 2048R/DA95F273 and from this line you need DA95F273

Now you can edit the repositorio configuration file and add the following part to your custom repository.

<Repository custom-repo>
  local = custom-repo/custom/6/x86_64/
  type  = Yum
    key      = DA95F273
    password = passw0rd

For Apt repositories you have to extend the configuration with the same parameters.

If you don't want to add your password into the configuration file, you can just omit the password line. repositorio will ask you for the password during execution.