You are not logged in.

#1 2012-03-14 02:53:49

pottzie
Member
Registered: 2010-05-08
Posts: 117

[solved]"Not enough random bytes" when trying to get key generated

Just tried installing revolver. When it came time to install it after downloading, I got a warning saying that I needed to generate a key by running pacman-key --init. When I do, I get an error message saying that I don't have enough random bytes. That seems odd, as this is a fresh install, with nothing much more than the kernel in place right now.
A quick web search came up with running ls -R /, and I ran that but still get the same message when I try pacman-key --init.

Last edited by pottzie (2012-03-14 04:23:17)

Offline

#2 2012-03-14 03:08:25

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,176
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

Have you tried stfwing? This variety of thread is getting a little overdone.


Linux is NOT Windows | The Rootless Root
Toshiba Satellite i5-3230M 2.6GHz CPUs, 4Gb RAM, ArchLinux, wmii, nVidia GeForce GT 740M.

Offline

#3 2012-03-14 03:13:48

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,938

Re: [solved]"Not enough random bytes" when trying to get key generated

pottzie wrote:

That seems odd, as this is a fresh install, with nothing much more than the kernel in place right now.

The ironic part is that seems the perfect argument as to why your system would not have enough random bytes.  The answer is, use your system for other things while it is waiting.  It collects entropy (the measure of the disorganization of things) from unpredictable stuff -- like the loose nut in front of the keyboard smile

Oh, and welcome to Arch


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Online

#4 2012-03-14 03:14:31

pottzie
Member
Registered: 2010-05-08
Posts: 117

Re: [solved]"Not enough random bytes" when trying to get key generated

Did a Google search and gave it a shot. Then posted here.

Offline

#5 2012-03-14 03:15:13

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

You might be confusing random bytes with free bytes. The message doesn't mean that you don't have enough free space. It means that there isn't enough "randomness" (i.e. entropy) on your system to generate a new random key.

The kernel collects random bits from input such as the mouse and keyboard as well as other things on the system that are essentially random. When an application needs a truly random stream of bits, it can read that from the kernel, but the bits get used up and need to be regenerated.

In this case, the system doesn't have enough so it issues a warning. If you read the full warning, it says that it needs more input and seems to hang. Leave the application running and do something else for a while (moving the mouse around, type random text in an editor, play a game, watch youtube, etc). Eventually you'll get enough random bits to generate the key.

You may have less entropy on your system because it's a fresh install. If you have more on the disk and more processes running, there are more sources of entropy. I don't know how much of a role that plays though.

Summary: leave pacman-key running and do something else on the computer for a little while

Btw, if you want to know how much entropy is available, run

cat /proc/sys/kernel/random/entropy_avail

Offline

#6 2012-03-14 03:21:34

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,176
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

pottzie wrote:

Did a Google search and gave it a shot. Then posted here.

I started typing in:

Me Googling Stuff wrote:

linux "not enough random bytes available"

- but Google beat me to it, it already guessed the rest of the line before I finished typing "random".

This should, first of all, tell you that it's a common search, and secondly, I would expect there to be an answer somewhere in the 13500 responses. Indeed, we had exactly the same question last week, and the week before that.


Linux is NOT Windows | The Rootless Root
Toshiba Satellite i5-3230M 2.6GHz CPUs, 4Gb RAM, ArchLinux, wmii, nVidia GeForce GT 740M.

Offline

#7 2012-03-14 03:22:26

pottzie
Member
Registered: 2010-05-08
Posts: 117

Re: [solved]"Not enough random bytes" when trying to get key generated

cat /proc/sys/kernel/random/entropy_avail shows 452 (!)

I'm at a loss as to how to do something else on a fresh install with no X-windows or window manager installed...

Sorry if it's a common question, but the fact that I have basically noting installed threw me. I've had it happen once on an Arch set up that was a few months old, and, yes, doing something else cleared it up. But on an install that has nothing, it seemed odd.

Last edited by pottzie (2012-03-14 03:25:09)

Offline

#8 2012-03-14 03:24:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [solved]"Not enough random bytes" when trying to get key generated

Have you tried reading the wiki? It does have an article on the command you're using: 'pacman-key'.
https://wiki.archlinux.org/index.php/Pa … entropy.3F

Last edited by karol (2012-03-14 03:24:48)

Offline

#9 2012-03-14 03:27:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,938

Re: [solved]"Not enough random bytes" when trying to get key generated

ping google.com
or
find / -name \*


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Online

#10 2012-03-14 03:28:09

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

pottzie wrote:

Sorry if it's a common question, but the fact that I have basically noting installed threw me. I've had it happen once on an Arch set up that was a few months old, and, yes, doing something else cleared it up. But on an install that has nothing, it seemed odd.

You're still not understanding the problem. It's BECAUSE it has nothing that it takes longer.

Run the pacman-init command, then use alt+ctrl+f2 to switch to a different terminal and have fun running commands like "ls -lR /" and "find / -exec du {} \+" etc for a few minutes or however long it takes. Switch back with ctrl+alt+f1.

Offline

#11 2012-03-14 03:28:53

pottzie
Member
Registered: 2010-05-08
Posts: 117

Re: [solved]"Not enough random bytes" when trying to get key generated

karol, thanks for the link. All I can come up with is re-running the command, as there is no mouse to move or anything else. When i ran it, it came up with the same message, and it's been a while and I've run some other commands.

Maybe I should just try skipping it and forging ahead with the install, but i'd like to get past this.

Offline

#12 2012-03-14 03:45:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [solved]"Not enough random bytes" when trying to get key generated

@Xyne
The wiki says "Using a second console via Alt+F2-6 will not work." but I only moved that text from pacman article https://wiki.archlinux.org/index.php?ti … did=186821
Should I remove that part?

As for https://bugs.archlinux.org/task/28027, I will try to find some time to report it upstream.

Offline

#13 2012-03-14 03:52:18

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,787
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

karol wrote:

@Xyne
The wiki says "Using a second console via Alt+F2-6 will not work."

It worked for me on my recent install (all three times tongue)

OP: Maybe you should try reading what people have been posting here for you: the solution is explicitely present twice and instructions on how to find the solution are in the other posts...


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#14 2012-03-14 03:56:40

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

karol wrote:

@Xyne
The wiki says "Using a second console via Alt+F2-6 will not work." but I only moved that text from pacman article https://wiki.archlinux.org/index.php?ti … did=186821
Should I remove that part?

If entropy is collected by the kernel then I would assume that all system activity would contribute to it, but I don't really know how it works.

Offline

#15 2012-03-14 04:08:02

pottzie
Member
Registered: 2010-05-08
Posts: 117

Re: [solved]"Not enough random bytes" when trying to get key generated

I even tried rebooting, still no dice. The Ctrl-Alt-#f2 works, and I ran ls -lR /. It ran, then when I tried 'find / -exec du {}\+' it said that -exec needed a missing argument. Still can't get the key to work. And when I try to go ahead with the rest of the install, every time I try to install anything, I get the same response, so I'm on hold until I get around this.
jasonryan says that the answer is staring me in the face. I need to have it develop bad breath so I see it.

Just tried to get 'find -name \*' to see what happened. Said unknown predicate '-name'.

But somewhere in all of this, the key managed to somehow find a way to generate. So, after all this, the fix was.....?
Anyway, it works. i'll take it.

Last edited by pottzie (2012-03-14 04:22:11)

Offline

#16 2012-03-14 04:32:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 12,938

Re: [solved]"Not enough random bytes" when trying to get key generated

pottzie wrote:

So, after all this, the fix was.....?

... patience.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
----
How to Ask Questions the Smart Way

Online

#17 2012-03-14 05:03:23

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,320

Re: [solved]"Not enough random bytes" when trying to get key generated

The fact that you encountered this issue at all means you need to read pacmans output and this wiki article

Offline

#18 2012-03-14 05:14:13

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

skunktrader wrote:

The fact that you encountered this issue at all means you need to read pacmans output and this wiki article

Wtf do pacnew and pacsave files have to do with this?



It's like this thread is in some parallel universe where the laws of logic are different. I bet this is what insanity feels like.

Offline

#19 2012-03-14 05:39:48

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,320

Re: [solved]"Not enough random bytes" when trying to get key generated

Last time I checked, the default pacman config disabled all package signing.  The only reason you hit this is if you either explicitly enable it or forget to merge the pacnew file

Offline

#20 2012-03-14 06:00:49

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

You hit this if your system requires time to generate enough entropy to create the key. It doesn't matter what you have in pacman.conf. When you run pacman-key --init, it has to generate a key.  Of course, if you don't bother with package signing then you avoid the need to generate the key, the same way you never have to pay for something if you never buy it.

The only issue was that he didn't wait long enough for the system to collect the necessary entropy. He kept growing impatient and killing pacman-key, and was too impatient to fully read the replies in this thread. There was no error.

Offline

#21 2012-03-14 14:43:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [solved]"Not enough random bytes" when trying to get key generated

jasonwryan wrote:
karol wrote:

@Xyne
The wiki says "Using a second console via Alt+F2-6 will not work."

It worked for me on my recent install (all three times tongue)

Thanks for confirmation, fixed: https://wiki.archlinux.org/index.php?ti … did=186871


Now it says:

How can I collect entropy?

Moving your mouse around, pressing random characters at the keyboard or running some disk-based activity e.g. updatedb in another virtual console can solve it. It may take a while so please be patient.

Offline

#22 2012-03-14 15:58:04

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

karol wrote:

Now it says:

How can I collect entropy?

Moving your mouse around, pressing random characters at the keyboard or running some disk-based activity e.g. updatedb in another virtual console can solve it. For truly random data, roll a die and echo the results in another terminal. You may also draw cards randomly from a deck and echo the suite and value. It may take a while so please be patient.


tongue

Offline

#23 2012-03-14 16:09:22

pottzie
Member
Registered: 2010-05-08
Posts: 117

Re: [solved]"Not enough random bytes" when trying to get key generated

I couldn't install any package, even after getting the key. All of them said that they couldn't verify the source. I found the problem, and yes, it was something I did. I couldn't get Arch to update after installing Arch. While trying to get the update problem fixed, i had un-commented "SigLevel = PackageRequired" in /etc/pacman.conf. 
After putting the hash mark in front of the second line in core, community and extra, pacman works.

Offline

#24 2012-03-15 03:15:03

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,688
Website

Re: [solved]"Not enough random bytes" when trying to get key generated

You need to import the Arch Linux Master Keys and then set their trust level to at least "marginal".

When you have time, sit down and carefully read the following:

https://wiki.archlinux.org/index.php/Package_signing
http://allanmcrae.com/2011/12/pacman-pa … rch-linux/
http://www.archlinux.org/master-keys/

Offline

Board footer

Powered by FluxBB