Many Apache commands, such as apache2 -v and apachectl graceful are failing with this message:

(38)Function not implemented: AH00141: Could not initialize random number generator

Searches online have suggested this could be caused by Chinese characters in the PATH; I don't see any characters except a-z and slash. Others have suggested missing /dev/random and /dev/urandom; both are present on my system.

If I run cat /proc/sys/kernel/random/entropy_avail, I get numbers between about 130 and 250. Is this too low? Could this have something to do with it?

Other possibilities?

Ubuntu 16.04.7 LTS
Apache 2.4.46

  • Are you using Apache from a ppa? Mar 13, 2021 at 16:54
  • I was using: http://ppa.launchpad.net/ondrej/apache2/ubuntu. Removing that and downgrading to Apache 2.4.18 made no difference. Mar 14, 2021 at 13:50

4 Answers 4


According to this Debian bug report, it looks like Apache expects a kernel function to be there, that isn't necessarily there with every kernel:

The issue is that if the library is configured (at build time) to USE_GETRANDOM, then it assumes that the getrandom() call will be available and if it fails it becomes a fatal error. On my system, I don't have getrandom() because I'm running an ancient kernel, but others could (more legitimately) have the option disabled on a recent custom-built kernel.

The best solution would probably be to update to a more recent version of Ubuntu. Ubuntu 16.04 is more than five years or ten release cycles old and will lose support in less than a month. Or as the maintainer of the mentioned PPA put it:

With the experience of Ubuntu 14.04 Trusty EOL, I can't stress enough that you should plan ahead and have your servers already upgraded by now. Yesterday was too late.

  • 2
    Ubuntu 16.04 is supposed to have extended security support for several more years. It ought to keep working. Updating the entire OS is not a solution to the urgent need to get Apache up again. Mar 14, 2021 at 14:15

I'd like to thank @Liam Morland for his answer above which led me to rectify this issue after an ill-advised apt-get update on Ubuntu 16.04. For those who might find it useful, here's exactly what I did:

  1. Checked the log for apt-get to see exactly what software had been upgraded in the last round, and therefore what needed downgrading. sudo tail /var/log/apt/history.log

  2. Searched through the data there to ascertain what varies of libapr1 and libutil1 I had installed. I ascertained that for me it was:

  • libapr1
  • libaprutil1
  • libaprutil1-dbd-sqlite3
  • libaprutil1-ldap

Your system may vary!

  1. Installed aptitude (sudo apt-get install aptitude). It is incredibly useful and gave me guidance on how to fix the dependencies, whereas apt-get gave me gibberish when I tried to downgrade.

  2. Using the command sudo aptitude versions libapr1 sudo aptitude versions libaprutil1 I noted the exact version numbers that aptitude could supply. In my case, the version of libaprutil1 couldn't just be 1.5.4, it had to be 1.5.4-1build1.

  3. Using the = sign to specify version, I ran sudo aptitude install libapr1=1.5.2-3. Aptitude then gave me a list of other software which would have been downgraded or stop working if I proceeded. I quit the install process, and using the error, crafted a single command to downgrade all the software that aptitude had identified. This was mine:

sudo aptitude install libapr1=1.5.2-3 libaprutil1=1.5.4-1build1 libaprutil1-ldap=1.5.4-1build1 libaprutil1-dbd-sqlite3=1.5.4-1build1 apache2=2.4.18-2ubuntu3.17 apache2-bin=2.4.18-2ubuntu3.17 apache2-data=2.4.18-2ubuntu3.17

This was based on my specific installation, so please check what you have before running this command.

  1. I gave Apache a restart and everything was working fine again!

I hope this helps anyone else on the road.


I solved it by downgrading libapr1 from 1.7.0 to 1.5.2. To make it work, I had to downgrade libaprutil1 (and two libaprutil1-*) from 1.6.1 to 1.5.4. I also had to stick with Apache 2.4.18.


is your machine running inside Solus / openvz? then kernel from openvz is too old... machines here had same prob under solus / openvz (kernel 2.6.xx)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .