创建debian存储库的简单命令行实用程序
vdt.simpleaptrepo的Python项目详细描述
创建apt存储库的简单命令行工具。这将在debian和ubuntu上工作。
安装:
首先从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包复制到组件目录中并更新repo:
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):
- 已检查是否支持Python3.7
0.0.4(2017-11-20):
- 添加了一个--skip-signed选项,以便我们可以跳过已经签名的debian包
- 增加了Python3支持
有用的网址:
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