通过CLI / shell提示尝试rpm安装时,文件安装没有问题。
/bin/rpm -ivU --nodeps --force --root /mnt /tmp/readline-4.2-4.ppc.rpm
当我们通过system()
API尝试相同的操作时,会抛出以下错误。
ret = system("/bin/rpm -ivU --nodeps --force --root /tmp/rpm /tmp/readline-4.2-4.ppc.rpm");
printf("ret = %d\n", ret);
来自控制台的错误
Preparing packages for installation...
readline-4.2-4
/bin/sh: error while loading shared libraries: libreadline.so.4.1: cannot open shared object file: No such file or directory
error: execution of %post scriptlet from readline-4.2-4 failed, exit status 127
ret = 256
We have also tried debugging using strace. Please find the strace logs.
write(38, "sfile=/etc/ld.so.conf\nif ! grep "..., 116) = 116
close(38) = 0
munmap(0x37f4d000, 8192) = 0
dup(1) = 38
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x37f48068) = 23955
waitpid(23955, /bin/sh: error while loading shared libraries:
libreadline.so.4.1: cannot open shared object file: No such file or directory
[{WIFEXITED(s) && WEXITSTATUS(s) == 127}], 0) = 23955
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23955, si_status=127, si_utime=0, si_stime=0} ---
有人可以帮助我们吗?