运行gpg --gen-key生成key时出现卡住的问题

35 篇文章 0 订阅

背景

  在搭建Ubuntu16.04的本地apt源时,需要运行“gpg –gen-key”命令,但是在执行该命令时,出现了:“Not enough random bytes available. Please do some other work to give the OS a chance to collect more ”的提示,而且一直卡住。

分析

  更详细的提示,参加:

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.

  根据提示,该命令生成key时,需要kernel为该程序生成足够多的随机数,因此,我们只需要为kernel生成随机数即可。

解决方法:

  安装rng-tools工具,该工具可以像指定文件生成随机数。这里,我们不需要退出原正在执行gpg –gen-key命令的console,新建一个终端,执行如下命令。命令执行完成后,原来卡住的界面就恢复运行了。
“`
aptgetinstallrngtools rng -r /dev/urandom
···

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值