正在检查登录状态... | 繁體中文 | 设为首页 | 加入收藏
点击:1286 | 评论:0 | 辅助功能: 复制 | 打印 | 字体: | |

创建自己的yum源,创建自己的签名解决xxx.rpm is not signed的问题

作者: 蓝天下云层上 发表于 最后更新于
版权声明:转载请征求作者同意,转载时必以超链接形式标明文章原始出处和作者信息及版权声明。
/blog/weblog-20573-1.html
创建自己的yum源,就可以升级自己的软件包。

1.创建你自己的源目录,分别对应32位平台和64位平台
# mkdir -p /var/www/html/yum/centos/4.6/i386
# mkdir -p /var/www/html/yum/centos/4.6/x86_64
# mkdir -p /var/www/html/yum/centos/4.6/ours

2.复制我们自己编译的rpm包到ours源的目录里
cp ours-xxx.rpm /var/www/html/yum/centos/4.6/ours

此时你自己的源已经可以使用了,但是我们自己编译的包安装时会有xxx.rpm is not signed的问题,需要屏蔽gpgcheck,要解决这个问题请继续下边的步骤。

yum install gpg
gdg --gen-key
Please select what kind of key you want:
(1) DSA and Elgamal (default)
(2) DSA (sign only)
(5) RSA (sign only)
Your selection?回车
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)回车
Please specify how long the key should be valid.
0 = key does not expire
= key expires in n days
w = key expires in n weeks
m = key expires in n months
y = key expires in n years
Key is valid for? (0)0回车
Key does not expire at all
Is this correct? (y/N)y回车
Real name: name回车
Email address: email回车
Comment: for CentOS回车
Enter passphrase:密码回车
Repeat passphrase:密码回车


如出现
Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 283 more bytes)

解决办法
#yum install rng-utils
#cat /proc/sys/kernel/random/entropy_avail
#rngd -r /dev/urandom -o /dev/random -f -t 1
#watch -n 1 cat /proc/sys/kernel/random/entropy_avail

然后我们将这个key导出,这样我们就可以在客户端导入这个key,这个key的作用是确保你从源里安装的rpm包都是经过源的创建者认证过的。
gpg --export -a 'zeng mingjie' > RPM-GPG-KEY
rpm --import http://your.domain.com/yum/centos/5.4/RPM-GPG-KEY

然后用这个key给源里的rpm包做签名
rpm --addsign *.rpm

vi ~/.rpmmacros
添加如下两行,用行编译程序时添加签名
%_signature gpg
%_gpg_name zeng mingjie


现在就可以在客户端测试自己的源是否工作正常了。

此日志的引用通告 URL:
http://www.imx365.net/blog/tb.cgi/20573

其实我一直都不知道您在想些什么,有什么感触。说真的,您的评论对于我来说很重要...

还没有人评论过

发表评论
  • (地址不公开)

(访客)