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
--------------------------------------------------------------------------------------------