Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install opendkim because cannot find bsd/string.h

I tried to install OpenDKIM 2.9.2 on AWS to generate the DKIM public & private keys. And when I run sudo ./configure --with-openssl=/usr/include/openssl under the opendkim source code folder, it gave me the following error messages.

checking bsd/string.h usability... no
checking bsd/string.h presence... no
checking for bsd/string.h... no
checking for strlcat... no
checking for library containing strlcat... no
checking for library containing strlcpy... no
checking for strlcpy... no
checking for library containing strlcat... (cached) no
checking for library containing strlcpy... (cached) no
configure: error: no strlcpy/strlcat found

I searched the system and I found the string.h files locate at the following folders

/usr/include/bits/string.h
/usr/include/string.h
/usr/include/linux/string.h

And I created a folder called bsd under /usr/include (/usr/include/bsd), and created a soft link to the /usr/include/string.h. Then the install process can find the string.h file, but it still cannot find the strlcat and strlcpy functions in that file. So I guess that I need to installed libbsd. Then I ran "whereis libbsd" and I got "/usr/lib64/libbsd.a". So I guess that the lib has been installed.

So now I have no idea about how to fix the issue and install OpenDKIM from source.

Please help me on this. Thanks in advance.

like image 349
Charles Avatar asked Jun 30 '14 06:06

Charles


2 Answers

You need to install libbsd-dev

if you are using ubuntu

sudo apt-get install  libbsd-dev

if you are using centOS

sudo yum install  libbsd-devel

Hope this helps you

like image 194
Rahul R Dhobi Avatar answered Nov 02 '22 08:11

Rahul R Dhobi


I realize an answer has already been selected. But this worked for me on a new CentOS 6.x installation on DigitalOcean.

  1. Install RHEL EPEL Repos

    wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

  2. Yum for libbsd-devel

    yum install libbsd-devel

Reference: Installing RHEL EPEL Repo on Centos 5.x or 6.x, pkgs.org

like image 24
James Wong Avatar answered Nov 02 '22 09:11

James Wong