报错显示找不到 “ld”这个文件 whereis ld 查询一下这个文件位置 whereis ld [root@localhost redis-5.0.8]# whereis ld ld: /usr/bin/ld.gold /usr/bin/ld /usr/bin/ld.bfd /usr/share/man/man1/ld.1.gz
打开这个目录查看以下该"ld"文件信息
ll /usr/bin/ld*
[root@localhost bin]# ll /usr/bin/ld* lrwxrwxrwx. 1 root root 20 11月 28 11:48 /usr/bin/ld -> /etc/alternatives/ld -rwxr-xr-x. 1 root root 1006192 11月 1 2021 /usr/bin/ld.bfd -rwxr-xr-x. 1 root root 5302 5月 18 2022 /usr/bin/ldd -rwxr-xr-x. 1 root root 5354104 11月 1 2021 /usr/bin/ld.gold -rwxr-xr-x. 1 root root 11440 11月 6 2016 /usr/bin/ldns-chaos -rwxr-xr-x. 1 root root 11520 11月 6 2016 /usr/bin/ldns-compare-zones -rwxr-xr-x. 1 root root 15728 11月 6 2016 /usr/bin/ldnsd -rwxr-xr-x. 1 root root 41784 11月 6 2016 /usr/bin/ldns-dane -rwxr-xr-x. 1 root root 41032 11月 6 2016 /usr/bin/ldns-dpa -rwxr-xr-x. 1 root root 15720 11月 6 2016 /usr/bin/ldns-gen-zone -rwxr-xr-x. 1 root root 11472 11月 6 2016 /usr/bin/ldns-key2ds -rwxr-xr-x. 1 root root 24240 11月 6 2016 /usr/bin/ldns-keyfetcher -rwxr-xr-x. 1 root root 15680 11月 6 2016 /usr/bin/ldns-keygen -rwxr-xr-x. 1 root root 11360 11月 6 2016 /usr/bin/ldns-mx
发现当前ld是一个软连接,而且该软连接一直在闪烁
进入该软连接目录下,发现软连接失效,已不存在ld:
[root@localhost bin]# cd /etc/alternatives/
[root@localhost alternatives]# ll
总用量 0
lrwxrwxrwx. 1 root root 35 11月 29 14:54 java -> /home/install/jdk1.8.0_144/bin/java
lrwxrwxrwx. 1 root root 15 11月 29 16:35 ld -> /usr/bin/ld.bfd
回到上面闪烁的目录下/etc/alternatives,创建软连接 ld
[root@localhost bin]# ln -s /usr/bin/ld.bfd ld [root@localhost bin]# ll /usr/bin/ld*
最后输入 make
至此问题解决