这个问题困扰了我好久了。我花了好几个小时试图找出问题所在,但就是解决不了。当我尝试使用sudo apt-get install slapd
安装的所有其他 OpenLDAP 和 ldap-utils 时,发生了以下情况:
The following NEW packages will be installed:
slapd
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/1738 kB of archives.
After this operation, 4199 kB of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_SG:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_SG.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package slapd.
(Reading database ... 174703 files and directories currently installed.)
Unpacking slapd (from .../slapd_2.4.31-1+nmu2ubuntu3_amd64.deb) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Processing triggers for man-db ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Processing triggers for ufw ...
Processing triggers for ureadahead ...
Setting up slapd (2.4.31-1+nmu2ubuntu3) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Creating initial configuration... Loading the initial configuration from the ldif file () failed with
the following error while running slapadd:
53358740 str2entry: invalid value for attributeType objectClass #0 (syntax 1.3.6.1.4.1.1466.115.121.1.38)
slapadd: could not parse entry (line=1038)
dpkg: error processing slapd (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for ufw ...
Processing triggers for ureadahead ...
Errors were encountered while processing:
slapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
任何帮助,将不胜感激。
答案1
讯息
“53358740 str2entry:attributeType objectClass #0 的值无效(语法 1.3.6.1.4.1.1466.115.121.1.38)”
似乎对于找到解决问题的方法至关重要。
我认为您的 objectClass 定义格式不正确。安装 ldap 时,它会将一些默认 objectClass 定义添加到您的 ldap 树中。其中一个可能已损坏或被修改,因此尝试添加时会失败。
修复 objectClass
grep -R str2entry /etc/
应该可以帮助你找到文件
或者也许最简单的解决方案是完全清除您的 ldap 安装,以便您从头开始安装过程。