[AMH]CentOS9安装postfix失败,请问怎么解决?

新手上路,请多包涵

这是我的部分安装日志

[Notice] postfix-3.5 is not installed.
[db*-devel Installing] ************************************************** >>
Last metadata expiration check: 0:36:46 ago on Wed Nov 1 19:22:24 2023.
Package dbus-devel-1:1.12.20-8.el9.x86_64 is already installed.
Package dbus-glib-devel-0.110-13.el9.x86_64 is already installed.
Package dbusmenu-qt5-devel-0.9.3-0.28.20160218.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[db4-devel Installing] ************************************************** >>
Last metadata expiration check: 0:36:48 ago on Wed Nov 1 19:22:24 2023.
No match for argument: db4-devel
Error: Unable to find a match: db4-devel
[libdb-devel Installing] ************************************************** >>
Last metadata expiration check: 0:36:49 ago on Wed Nov 1 19:22:24 2023.
Package libdb-devel-5.3.28-53.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Creating mailbox file: File exists
useradd: user 'amh-mail' already exists
Last metadata expiration check: 0:36:51 ago on Wed Nov 1 19:22:24 2023.
Dependencies resolved.

好像db4-devel没有找到,然后末尾还有一部分日志

DDEF_SENDMAIL_PATH=\"/usr/local/postfix-3.5/usr/sbin/
sendmail\" -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DHAS_DEV_URANDOM -DHAS_PCRE -UUSE_DYNAMIC_LIBS -DDEF_SHLIB_DIR=\"no\" -UUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat -Wno-comment -fco
mmon -g -O -I. -DLINUX5 -c dict_nis.c
dict_nis.c:42:10: fatal error: rpcsvc/ypclnt.h: No such file or directory
42 | #include
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:192: dict_nis.o] Error 1
make: *** [Makefile:94: update] Error 1
postfix-install: Error: no bin/postconf file. Did you forget to run "make"?
chown: cannot access '/usr/local/postfix-3.5/var/spool/postfix/private': No such file or directory
chown: cannot access '/usr/local/postfix-3.5/var/spool/postfix/public': No such file or directory
chown: cannot access '/usr/local/postfix-3.5/var/spool/postfix/public': No such file or directory

按照思否上搜到的postfix无法安装的答复内容执行了

yum install db*-devel

Last metadata expiration check: 0:40:55 ago on Wed 01 Nov 2023 07:22:24 PM CST.
Package dbus-devel-1:1.12.20-8.el9.x86_64 is already installed.
Package dbus-glib-devel-0.110-13.el9.x86_64 is already installed.
Package dbusmenu-qt5-devel-0.9.3-0.28.20160218.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

感谢amh的回答,我按照在centos.pkgs.org找到的安装方法执行

dnf --enablerepo=crb install libnsl2-devel
Total                                                                                           282 kB/s | 145 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                        1/1 
  Installing       : libtirpc-devel-1.3.3-2.el9.x86_64                                                                      1/2 
  Installing       : libnsl2-devel-2.0.0-1.el9.x86_64                                                                       2/2 
  Running scriptlet: libnsl2-devel-2.0.0-1.el9.x86_64                                                                       2/2 
  Verifying        : libnsl2-devel-2.0.0-1.el9.x86_64                                                                       1/2 
  Verifying        : libtirpc-devel-1.3.3-2.el9.x86_64                                                                      2/2 

Installed:
  libnsl2-devel-2.0.0-1.el9.x86_64                               libtirpc-devel-1.3.3-2.el9.x86_64 

Complete!

成功安装libnsl2-devel
在面板安装postfix也成功安装上了,最后再次感谢amh的答复,本以为要等十天半月我的提问才会被注意到,居然有这么快的回复效率,点赞!!!👍👍👍

阅读 1k
avatarAI BotBETA

这个问题与程序配置和安装相关,涉及到Linux系统下Postfix的安装。根据你提供的日志,问题可能出在db4-devel包没有找到,以及dict_nis.c编译出错导致。

以下是一些可能的解决方案:

  1. 确保已经安装了db4-devel包。这个包包含了ypclnt.h头文件,如果没有安装,会导致编译出错。你可以通过以下命令来安装:
sudo yum install db4-devel
  1. 确保在编译dict_nis.c时能够找到ypclnt.h头文件。如果db4-devel包已经安装,但头文件仍然找不到,可能是因为头文件路径没有设置正确。可以尝试将头文件的路径添加到编译参数中,例如:
gcc -I/path/to/db4-devel/include dict_nis.c -o dict_nis.o

请根据实际情况替换/path/to/db4-devel/include为正确的头文件路径。

  1. 检查日志中提到的权限问题。根据日志,有一些目录的权限可能没有正确设置,导致无法访问。可以尝试使用以下命令修复权限:
sudo chown -R postfix:postfix /usr/local/postfix-3.5/var/spool/postfix/private
sudo chown -R postfix:postfix /usr/local/postfix-3.5/var/spool/postfix/public

这些命令会将相关目录的权限设置为Postfix用户和组所有。

  1. 如果以上步骤仍然无法解决问题,建议检查系统环境是否有其他异常,例如缺少其他依赖库或配置文件不正确等。可以尝试查看更多日志或搜索类似的问题解决方案来进行排查。

请注意,以上解决方案是基于日志和问题描述进行的推测,实际情况可能因系统环境和具体操作而有所不同。如果问题仍然存在,建议提供更多详细信息或寻求专业的技术支持帮助。

1 个回答

应该是没安装好libnsl2包的问题,重新安装一次再看,
amh download postfix
amh postfix install
如果还失败,再提供安装日志。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏