Build Your Own Debian Repository: The quick way

---
date: Jun 07, 2020
tags:
-
-
-
-
---

TL;DR

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.

Setup

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:

1
2
3
4
5
6
7
Origin: repo.example.com
Label: repo.example.com
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.

Navigation


The site is proudly powered by Hexo hosted on GitHub Pages.

The site is powered by the glorious CSS from bettermotherf**kingwebsite.com with some tweaks. Censored the f-word for good.

Main | Access | CDN | RSS | Sitemap
2008 - 2020 | Patrick WU Jinming