跳转到主要内容

一个用于创建Debian仓库的简单命令行工具

项目描述

简单的命令行工具,用于创建apt仓库。这将适用于Debian和Ubuntu。

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

安装

首先从pypi安装

pip install vdt.simpleaptrepo

此工具是一些Debian特定软件包的包装器,因此您需要首先安装它们

apt-get install gnupg dpkg-sig apt-utils

显示可用的命令

simpleapt --help

创建仓库

首先您需要创建一个gpg密钥来签名您的软件包。这不是强制性的,但强烈推荐

simpleapt create-gpg-key

复制并记住密钥的哈希值。输出看起来像这样

gpg: key 10FB8BDC marked as ultimately trusted

因此复制 10FB8BDC 哈希,您稍后会需要它。

现在创建一个仓库

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

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

创建一个组件

在一个仓库中,您可以有多个组件

simpleapt add-component myrepo test

您现在会看到需要做什么

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 -

如果您喜欢,可以添加更多

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

看到我们的仓库在那里

simpleapt list-repos

myrepo (gpgkey: 10FB8BDC)
   test
   staging
   main

添加软件包

将一些Debian软件包复制到组件目录中,并更新仓库

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

当有很多软件包时,您可以使用 --skip-signed 选项跳过重新签名软件包

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

现在您可以安装这些软件包了!

变更日志

0.0.5 (2018-08-04):

  • 检查了对Python 3.7的支持

0.0.4 (2017-11-20):

  • 添加了 --skip-signed 选项,以便我们可以跳过已签名的 Debian 软件包

  • 添加了 Python 3 支持

有用的网址

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

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源代码分发

vdt.simpleaptrepo-0.0.5.tar.gz (5.9 kB 查看哈希值)

上传时间 源代码

支持者