创建自己的rpm-md源


1. Go to the repository folder

2. Generate the key (Inputs are shown in the red squares of the picture below)

  • gpg -q –gen-key


3. Try to open the a browser if it stops at (The blue square of the above picture)

  • We need to generate a lot of random bytes. It is a good idea to perform
    some other action (type on the keyboard, move the mouse, utilize the
    disks) during the prime generation; this gives the random number
    generator a better chance to gain enough entropy.

4. List the keys

  • gpg –list-key


 

5. Make a detached signature (repomd.xml.asc) to repomd.xml

  • gpg -a –detach-sign repomd.xml


 

6. Export the public key to repomd.xml.key

  • gpg -a –export <public_key> > repomd.xml.key


 

7. Import the trusted key of the repository

 

Done =)


创建自己软件源 type:rpm-md

   以下用参考文档的源码阐述源的制作过程,步骤如下:
一、开发源程序和编写SPECS文件
1.1  下载源码
$ wget http://ftp.gnu.org/gnu/hello/hello-2.1.1.tar.gz  #获取源码
1.2  创建目录
结构如下:
/-root
-------/-SOURCES
-------/-SPECS
1.3   将源码放在SOURCES目录下
$ cp hello-2.1.1.tar.gz   /root/SOURCES/
1.4   新建spec文件
$ vi /root/hello-2.1.1.spec   #添加内容,具体内容查看参考文档
二、制作软件的RPMS
$ rpmbuild  -ba /root/hello-2.1.1.spec   
三、创建源
3.1  创建REPO制作目录
$ mkdir /var/www
$ mkdir /var/www/suse_repo
$ mkdir /var/www/suse_repo/x86_64
3.2  将RPM包放入目录
$ cp /root/RPMS/x86_64/hello-2.1.1-1.x86_64.rpm  /var/www/suse_repo/x86_64/
3.3   执行创建
$ createrepo /var/www/suse_repo/x86_64/
四、添加源
$ zypper addrepo -t YUM /var/www/suse_repo/x86_64/    local_repo
显示结果:
Adding repository 'local_repo' [done]
Repository 'local_repo' successfully added
Enabled: Yes
Autorefresh: No
URI: dir:///var/www/suse_repo/x86_64
五、测验
$  zypper se hello

显示结果:
File 'repomd.xml' from repository 'local_repo' is unsigned, continue? [yes/no] (no): yes
Building repository 'local_repo' cache [done]
Loading repository data...
Reading installed packages...

S | Name  | Summary                     | Type  
--+-------+-----------------------------+--------
| hello | A Friendly Greeting Program | package

--------------------------------------------------------------------------------------------
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值