Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in gpg --key-gen

following error occured.

Not enough random bytes available. 
Please do some other work to give the OS a chance to collect more 
(Need 300 more bytes)

What's wrong?

share|improve this question
up vote 2 down vote accepted

/dev/random's entropy pool is depleted.

"do something" to generate disk activity, network traffic, etc... and the entropy will build.

"man random" for more info.

"cat /proc/sys/kernel/random/entropy_avail" to see how you're doing, then try the gpg process again.

share|improve this answer
As an example of what to do I started with 257 in entropy_avail I then did touch blah rm blah about 10 times now I have entropy_avail, so most any disk access should do. – Unkwntech Aug 6 '09 at 3:06
In case someone else encounters it: starting programs (ASLR? No idea) seems to consume some entropy (about 100). To watch the entropy pool, write a C program that reads the contents of the file and periodically writes it back (don't forget to lseek(fd, 0, SEEK_SET). – Lekensteyn Jan 28 '13 at 23:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.