Build Your Own Debian Repository: The quick way

date: Jun 07, 2020
- Linux
- Linux Packaging
- Ubuntu
- Debian
language: English
This post is more than 3 years old. If this is a technical post, the post will most likely not working, but feel free to try it and see if it works.


This is a quick little article to get you started with the Debian repository. I have been setting up Debian repositories for wslu and some other packages. You can check out my Debian and Kali Linux repository for wslu here and here.


We will set up the repository using reprepro. You can install reprepro using your distro’s package manager, for example, sudo apt install reprepro for debian-based operating systems.

Now, you can create Create a directory for your repository. Here, I will call it repo. Create a folder conf under the repo folder, and under conf folder, create a file called distributions with the following content:

Codename: trusty
Architectures: i386 amd64 source
Components: main
Description: example repo
SignWith: Yes

Here is a quick reference of this file:

More detailed documentation can be found here, or check man reprepro under conf/distributions section.

Now, you have complete the Debian repository. Now Let’s try to import a Debian package.

Sign and Import

You need to get your private key and Debian package ready. I have an article talking about a simple way you can build a Debian package: Packaging .deb using a simple script: Explained

Now let’s prepare our signing environment by running export GPG_TTY=$(tty), or include this line in your shell configuration file. This allows GPG-signing running in the terminal without throw out errors.

Now, import your GPG key using ‌gpg --import <key>. You can now sign packages with dpkg-sig -k <key> --sign builder /path/to/package.deb or dpkg-sig --sign builder /path/to/package.deb if your signing the package with default key.

Now you can import packages using reprepro -S <category> -b repo/ includedeb <codename> /path/to/package.deb. -S is always required.