# debrepo A lightweight command-line tool for managing Debian repositories. It allows you to initialize, maintain, and serve a Debian package repository using standard tools. Alternative to reprepro or aptly. ## Why debrepo? Existing tools like `reprepro` often limit repositories to a single version of a package, making rollbacks or maintaining historical versions difficult. While `aptly` is a powerful alternative, it can be complex to configure for smaller use cases. **debrepo** was built with **simplicity in mind**. It uses standard Debian tools (`dpkg-scanpackages`) to allow multiple versions of the same package to coexist in your repository seamlessly, without the overhead of complex database management. ## Dependencies Ensure the following are installed on your system: * `bash` * `dpkg-dev` (Required for `dpkg-scanpackages`) * `gpg` (For signing packages) * `python3` (Optional, for the built-in testing server) On Ubuntu/Debian: ```bash sudo apt update sudo apt install dpkg-dev gpg python3 ``` ## Installation Clone the repository and create a symlink to your binary path. ```bash git clone https://github.com/filiprojek/debrepo.git cd debrepo chmod +x debrepo.sh # Create a symlink so you can run 'debrepo' from anywhere sudo ln -s "$(pwd)/debrepo.sh" /usr/bin/debrepo ``` ## Getting Started ### 1. Generate a GPG Key You must have a GPG key to sign your repository. If you don't have one: ```bash gpg --gen-key ``` *Note the email address you use; you will need it for the configuration.* ### 2. Initialize Repository Create a directory for your repository and initialize the structure. ```bash mkdir my-archive cd my-archive debrepo init --repodir . ``` ### 3. Configuration Create configuration file at `apt-repo/config`. **Example `apt-repo/config`:** ```sh #!/bin/sh # GPG Key ID for signing (Must match your GPG key email) DEFAULT_GPG="user@example.com" # Repository Metadata ORIGIN="example.com" LABEL="my-custom-repo" SUITE="stable" CODENAME="stable" ARCHITECTURES="armhf amd64" COMPONENTS="main" DESCRIPTION="My custom Debian repository" ``` ### 4. Add Packages Add a `.deb` package to your repository. ```bash debrepo add /path/to/package_1.0_all.deb --repodir ./path/to/repository/ ``` ## Usage ```text USAGE: debrepo [OPTIONS] [DEB] [--repodir DIR] OPTIONS: init, -i, --init Create repository folder structure in the current directory. add, -a, --add Add a .deb package to the repository pool, update indices, and sign. del, -d, --del Remove a package from the repository. list, -l, --list List all packages currently in the repository. serve, -s, --serve Serve the repository using Python's built-in HTTP server (for testing). help, -h, --help Print this help message. --repodir