Cannot install opendkim because cannot find bsd/string.h
Asked Answered
U

3

6

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.

Ungrudging answered 30/6, 2014 at 6:22 Comment(0)
G
19

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

Gloxinia answered 30/6, 2014 at 6:57 Comment(6)
Maybe AWS EC2 server is not using the redhat yum repo list. When I ran yum info libbsd-dev, YUM cannot find a match. Is there a way that I can manually install that lib?Ungrudging
I found source code for libbsd-dev and I installed it. Then I install the opendkim again, and now the install process can find the string.h file, but it still cannot find the functions. I guess that the .h file only defines the function name and because AWS EC2 use redhat OS and it is not a bsd OS, there are no implementations of those functions. Am i right? And if I cannot fix this, is there a opendkim package for redhat? (Linux version 3.10.35-43.137.amzn1.x86_64 (mockbuild@gobi-build-31002) (gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) ) #1 SMP Wed Apr 2 09:36:59 UTC 2014)Ungrudging
it seems like compiler don't able to find libbsd please reinstall itGloxinia
Thank you so much for the reply. And I checked the content of the string.h file from libbsd-dev, and it didn't contain function body. I will try to create a local repo and let yum to search the dependancies. Maybe I don't have the dependancies installed.Ungrudging
I have figured out how to do it. Because I just need to generate the key, I didn't check other stuff but "opendkim-genkey" command. First, I installed "libbsd-0.6.0-3.fc21.x86_64.rpm" and "libbsd-devel-0.6.0-3.fc21.x86_64.rpm" on AWS EC2, and then installed "sendmail-devel". At last, get "opendkim-2.9.2.tar.gz" and install it like other linux package. Then the "opendkim-genkey" command has been installed and it is working.Ungrudging
I am agree with @Pavel, just trysudo yum install libbsd-develAmery
D
3

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

Deliciadelicious answered 16/7, 2014 at 5:55 Comment(1)
For Amazon Linux 2 cmd: sudo amazon-linux-extras install epel -yCrat
B
1

Also a note even though this has been closed - Amazon EC2 Linux also needs the EPEL repos...

yum-config-manager --enable epel > /dev/null
yum update
yum install libbsd-devel
Babby answered 17/10, 2016 at 3:46 Comment(1)
For Amazon Linux 2 cmd: sudo amazon-linux-extras install epel -yCrat

© 2022 - 2024 — McMap. All rights reserved.