出现问题
问题分析
解决方法
场景
当我们对某个源码包进行编译安装,再执行 configure 有时候会因为找不到库文件,报错如下:
[root@localhost ~]# ./configure/bin/ld: 找不到 -lcrypto
出现问题
/bin/ld: 找不到 -lcrypto
问题分析
因为编译要使用 lib 库文件,但是由于没有文件索引关系,导致搜索不到库文件,从而报错。
解决方法
通过使用 locate 加载库文件,创建索引关系,更新 lib 库,从而解决这个问题。
首先,加载库文件,创建索引关系
[root@localhost ~]# locate crypto/boot/grub2/i386-pc/crypto.lst/boot/grub2/i386-pc/crypto.mod/boot/grub2/i386-pc/cryptodisk.mod/usr/lib/grub/i386-pc/crypto.lst/usr/lib/grub/i386-pc/crypto.mod/usr/lib/grub/i386-pc/cryptodisk.mod/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/ablk_helper.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/aesni-intel.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/blowfish-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/camellia-aesni-avx2.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/camellia-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/cast5-avx-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/cast6-avx-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/crc32-pclmul.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/crc32c-intel.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/crct10dif-pclmul.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/ghash-clmulni-intel.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/glue_helper.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/salsa20-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/serpent-avx-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/serpent-avx2.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/serpent-sse2-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha-mb/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha256-mb/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha512-mb/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha512-ssse3.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/twofish-avx-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/twofish-x86_64-3way.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/twofish-x86_64.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha-mb/sha1-mb.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha256-mb/sha256-mb.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/arch/x86/crypto/sha512-mb/sha512-mb.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/algif_rng.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/ansi_cprng.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/anubis.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/arc4.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/authenc.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/authencesn.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/blowfish_common.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/blowfish_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/camellia_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/cast5_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/cast6_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/cast_common.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/ccm.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/cmac.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/crc32_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/crct10dif_common.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/crct10dif_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/cryptd.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/crypto_null.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/crypto_user.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/cts.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/deflate.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/des_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/dh_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/drbg.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/fcrypt.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/gcm.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/gf128mul.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/ghash-generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/jitterentropy_rng.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/khazad.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/lrw.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/mcryptd.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/md4.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/michael_mic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/pcbc.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/pcrypt.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/rmd128.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/rmd160.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/rmd256.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/rmd320.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/rsa_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/salsa20_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/seed.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/serpent_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/sha512_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/tcrypt.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/tea.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/tgr192.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/twofish_common.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/twofish_generic.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/vmac.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/wp512.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/xcbc.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/xor.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/xts.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/zlib.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/async_memcpy.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/async_pq.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/async_raid6_recov.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/async_tx.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/async_xor.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/crypto/async_tx/raid6test.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/ccp/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/chelsio/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/padlock-aes.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/padlock-sha.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/ccp/ccp.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/chelsio/chcr.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c3xxx/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c3xxxvf/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c62x/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c62xvf/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_common/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_dh895xcc/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_dh895xccvf/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c3xxx/qat_c3xxx.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c3xxxvf/qat_c3xxxvf.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c62x/qat_c62x.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_c62xvf/qat_c62xvf.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_common/intel_qat.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_dh895xcc/qat_dh895xcc.ko.xz/usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/crypto/qat/qat_dh895xccvf/qat_dh895xccvf.ko.xz/usr/lib64/.libcrypto.so.1.0.2k.hmac/usr/lib64/.libcrypto.so.10.hmac/usr/lib64/libcrypto.so.1.0.2k/usr/lib64/libcrypto.so.10/usr/lib64/libk5crypto.so.3/usr/lib64/libk5crypto.so.3.1/usr/pgsql-14/include/server/common/cryptohash.h/usr/pgsql-14/lib/pgcrypto.so/usr/pgsql-14/share/extension/pgcrypto–1.0–1.1.sql/usr/pgsql-14/share/extension/pgcrypto–1.1–1.2.sql/usr/pgsql-14/share/extension/pgcrypto–1.2–1.3.sql/usr/pgsql-14/share/extension/pgcrypto–1.3.sql/usr/pgsql-14/share/extension/pgcrypto.control
然后,创建库文件软链接
[root@localhost ~]# ln -s /usr/lib64/libcrypto.so.1.0.2k /usr/lib/libcrypto.so
之后,再次编译执行 configure 即可
[root@localhost ~]# ./configure