reprepro

Overview

This article describes how to set up a personal Debian package repository with reprepro1 step by step.

install reprepro package

First of all, Let’s install reprepro using package manager.


Assume that you are running Debian or any Debain-based distribution.
Just execute the following command to get reprepro installed in you system:

sudo apt update && apt install reprepro -y

Create OpenPGP key

OpenPGP key is used to sign the package matedata and the *.changes *.dsc files,
You must to create you own OpenPGP key to continue.

gunpg is the right tool can help us to do this。
It should be installed in your system by default. If not, install it manually:

sudo apt install gunpg

Then, execute gpg --gen-key and follow the instruction to generate a key.
You can refer to here2 for more information about openGPG.

Configure reprepro

Once you have your OpenPGP key generated correctly. You can start configuring reprepro.

First, create the reprepro configuration directory.

sudo mkdir -p /var/www/repos/apt/debian/conf

Then, create the configuration file named “distribution”, put it into conf directory.

cat /var/www/repos/apt/debian/conf
Origin: Your project name
Label: Your project name
Codename: <osrelease>
Architectures: i386 amd64 source
Components: main contrib non-free
Description: Apt repository for project x
SignWith: <key-id>

Third, add the second configuration file named “option” at the same position with “distribution”.

cat /var/www/repos/apt/debian/option
verbose
basedir /var/www/repos/apt/debian
ask-passphrase

(Optional) useing package form other mirror

This can be done by reprepro using overrides.

For example, if you want to use package for debian’s official repository.

Links

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注