Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1084412
  • 博文数量: 80
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 746
  • 用 户 组: 普通用户
  • 注册时间: 2018-06-12 20:01
个人简介

寫写code、调調bug、填填坑,僅此而已。

文章分类

全部博文(80)

文章存档

2019年(30)

2018年(50)

分类: 服务器与存储

2018-08-02 09:02:23

0.安装php、apache2
1.apt-get install reprepro
2.制作mykey.gpg 拷贝到~/gpg-keys 如何生成gpg,另外一篇文章待续
3.导入 gpg --import ~/gpg-keys/test_repo.gpg
查看是否导入成功命令> gpg --list-key
pub   4096R/12345678 2018-07-27
uid                  Example Repositroy (example Repositroy)

4.mkdir -p  /home/test/repo/conf
5.touch  /home/test/repo/conf/distributions
编辑内容:
Origin:example.repo
Label: example.repo
Codename: xenial
Architectures: armhf arm64
Components: main
Description: example apt repository
SignWith: 12345678
6.将制作好的example_201800730.1_arm.deb包上传至/home目录下
该deb包内DEBIAN目录下control文件内容如下:
Package: example-2.0
Version: 2.0.0-20180730.1
Section: utils
Depends: expect
Architecture: arm64
Priority: optional
Installed-Size: 123456
Maintainer: HotDoor
Description: test software


cd /home/test
reprepro -b repo/ includedeb xenial ./example_201800730.1_arm.deb

如果报以下错:
Exporting indices...
Could not find any key matching '12345678'!
ERROR: Could not finish exporting 'xenial'!
This means that from outside your repository will still look like before (and
should still work if this old state worked), but the changes intended with this
call will not be visible until you call export directly (via reprepro export)
Changes will also get visible when something else changes the same file and
thus creates a new export of that file, but even changes to other parts of the
same distribution will not!
There have been errors!
别担心,执行如下命令
gpg --export-secret-keys | gpg2 --import -
执行成功后,重新执行导入包命令,正常成功


7.移除上传的包
reprepro remove xenial example-2.0
=========
/var/www/html/ 建立软连接 (可以通过网页访问)
sudo ln -s /home/test/repo /var/www/html/repo

8.更新需要安装该包的arm
cd /etc/apt/
touch /etc/apt/sources.list.d/test.list
内容如下:
deb xenial main
将公钥test-repo.gpg 拷贝至/etc/apt/trusted.gpg.d
9.sudo apt-get update

10. sudo apt-get install example-2.0

参考链接(翻墙):
https://www.digitalocean.com/community/tutorials/how-to-use-reprepro-for-a-secure-package-repository-on-ubuntu-14-04
阅读(4371) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~