Skip to main content

A simple command line utility to create a debian repository

Project description

=================
vdt.simpleaptrepo
=================

Simple command line tool to create apt repositories. This will work on debian and ubuntu.

.. image:: https://api.travis-ci.org/devopsconsulting/vdt.simpleaptrepo.svg?branch=master
:target: https://travis-ci.org/devopsconsulting/vdt.simpleaptrepo

Installation:
=============

First install from pypi:

.. code-block:: bash

pip install vdt.simpleaptrepo

This tool is a wrapper for some debian specific packages, so you will need to install them first:

.. code-block:: bash

apt-get install gnupg dpkg-sig apt-utils


To show which commands are available:

.. code-block:: bash

simpleapt --help

Create a repository:
====================
First you need to create a gpg key to sign your packages with. This is not mandatory but highly recommended.

.. code-block:: bash

simpleapt create-gpg-key

Copy and remember the key's hash. The output looks something like this:

.. code-block:: bash

gpg: key 10FB8BDC marked as ultimately trusted

So copy the `10FB8BDC` hash, you will need it later.

Now create a repository:

.. code-block:: bash

simpleapt create-repo myrepo /www/ --gpgkey 10FB8BDC

Repository 'myrepo' created
Now add a component with the 'add-component' command


Create a component:
===================

In one repository you have multiple components:

.. code-block:: bash

simpleapt add-component myrepo test

You will see what you need to do now:

.. code-block:: bash

Component 'test' created in repo 'myrepo'

Now add some unsigned debian packages in the directory
and run the 'update-repo' command (see the 'add packages' section below)

Configure your webservice to set the www-root to /www/
Add http://<hostname>/myrepo/test / to your sources.list

Add the key on the host where you want to install the packages.
(This is only needed once per repository)
wget -qO - http://<hostname>/myrepo/test/keyfile | sudo apt-key add -

Add some more if you like:

.. code-block:: bash

simpleapt add-component myrepo staging
simpleapt add-component myrepo production

See that our repo is there:

.. code-block:: bash

simpleapt list-repos

myrepo (gpgkey: 10FB8BDC)
test
staging
main

Add packages:
=============

Copy some debian package into a component's directory and update the repo:

.. code-block:: bash

simpleapt update-repo myrepo test

Exported key 10FB8BDC to /www/myrepo/test/keyfile

Signed package /www/myrepo/test/my-package_0.0.1_all.deb
Creates Packages
Creates Packages.gz
Create Release with key 10FB8BDC
Create InRelease with key 10FB8BDC
Create Releases.gpg with key 10FB8BDC

When there a a lot packages you can skip resigning packages by using the ``--skip-signed`` option:

.. code-block:: bash

simpleapt update-repo myrepo test --skip-signed

Exported key 10FB8BDC to /www/myrepo/test/keyfile

Skipped signing /www/myrepo/test/my-package_0.0.1_all.deb

Creates Packages
Creates Packages.gz
Create Release with key 10FB8BDC
Create InRelease with key 10FB8BDC
Create Releases.gpg with key 10FB8BDC

Now you can install these packages!

Changelog:
==========

0.0.4 (2017-11-20):
-----------
- Added a ``--skip-signed`` option so we can skip already signed debian packages
- Added python 3 support


Useful URLS:
============

http://blog.packagecloud.io/eng/2014/10/28/howto-gpg-sign-verify-deb-packages-apt-repositories/

https://keyring.debian.org/creating-key.html

https://wiki.debian.org/SecureApt#How_apt_uses_Release.gpg

https://help.ubuntu.com/community/CreateAuthenticatedRepository

http://lists.gnupg.org/pipermail/gnupg-users/2004-May/022471.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vdt.simpleaptrepo-0.0.4.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file vdt.simpleaptrepo-0.0.4.tar.gz.

File metadata

File hashes

Hashes for vdt.simpleaptrepo-0.0.4.tar.gz
Algorithm Hash digest
SHA256 280e1d63488a4ea56fde92e3e57d11735cf0c33d2afa8c22fb124660de46a7ae
MD5 8b44c2a812818074a7d78b063fa74bc6
BLAKE2b-256 3586d8ad09acfb0b2165368cacf607e6e7ac732e42408655e70811b2a9686550

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page