bash: /etc/ld.so.conf: 权限不够

本文介绍了一种常见的 CUDA 路径配置错误及其解决方案。通过使用正确的 shell 命令,可以将 CUDA 库路径添加到系统的 ld.so.conf 文件中,从而避免加载库文件时出现的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.输入:

sudo echo '/usr/local/cuda-11.7/lib64' >> /etc/ld.so.conf

报错如下:
在这里插入图片描述
解决方法:

sudo sh -c "echo '/usr/local/cuda-11.7/lib64/' >> /etc/ld.so.conf"

问题解决~

root@ubuntu:/zlab_16t2/changqingteng# echo "/usr/local/lib" | tee /etc/ld.so.conf.d/freesasa.conf /usr/local/lib root@ubuntu:/zlab_16t2/changqingteng# ldconfig -v | grep freesasa /sbin/ldconfig.real: Can't stat /usr/local/lib/i386-linux-gnu: No such file or directory /sbin/ldconfig.real: Path `/usr/lib/i386-linux-gnu' given more than once (from /etc/ld.so.conf.d/i386-linux-gnu.conf:4 and /etc/ld.so.conf.d/i386-linux-gnu.conf:3) /sbin/ldconfig.real: Can't stat /usr/local/lib/i686-linux-gnu: No such file or directory /sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory /sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory /sbin/ldconfig.real: Path `/usr/local/lib' given more than once (from /etc/ld.so.conf.d/libc.conf:2 and /etc/ld.so.conf.d/freesasa.conf:1) /sbin/ldconfig.real: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory /sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once (from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:4 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3) /sbin/ldconfig.real: Path `/usr/lib32' given more than once (from /etc/ld.so.conf.d/zz_i386-biarch-compat.conf:3 and /etc/ld.so.conf.d/zz_i386-biarch-compat.conf:2) /sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once (from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3) /sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once (from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3) /sbin/ldconfig.real: Path `/usr/lib' given more than once (from <builtin>:0 and <builtin>:0) /sbin/ldconfig.real: /lib/i386-linux-gnu/ld-linux.so.2 is the dynamic linker, ignoring /usr/local/lib: (from /etc/ld.so.conf.d/freesasa.conf:1) /sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 is the dynamic linker, ignoring /sbin/ldconfig.real: /lib32/ld-linux.so.2 is the dynamic linker, ignoring 请分析错误原因,并给出详细解决步骤
最新发布
07-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Linda Fan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值