centos7 -linux 添加环境变量【/lib快捷方式和/bin不一样】最好的方法(和windows一样的原理)

本文详细介绍了在CentOS7中如何通过编辑.bash_profile文件来添加/lib路径的环境变量$LD_LIBRARY_PATH,包括具体步骤和验证方法,以及如何使更改立即生效。

CentOS7添加/lib路径的环境变量 【$LD_LIBRARY_PATH-lib的环境变量】

第一步:打开.bash_profile文件【当前用户有效】

$ vim  ~/.bash_profile 

第二步:添加环境变量路径

// 这个环境变量$LD_LIBRARY_PATH就是专门正对于/lib的

LD_LIBRARY_PATH=/user/local/Anaconda3/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH

 第三步:查看是否设置成功

// 查看是否设置成功

echo $LD_LIBRARY_PATH

第四步:执行下面命令更新或reboot重启电脑 

//  修改完毕后必须执行下面命令更新或重启才能生效

$ source  ~/.bash_profile

 

/etc/profile和~/.bash_profile等文件的区别和联系:https://blog.youkuaiyun.com/u010048823/article/details/51871825

 

[root@iZbp11irq8z6b1plo30y63Z trunk]# ffplay rtmp://121.43.231.156:1936/live/livestream ffplay version 3.4.13 Copyright (c) 2003-2023 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44) configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 pci id for fd 4: 1013:00b8, driver (null) gbm: failed to open any driver (search paths /usr/lib64/dri) gbm: Last dlopen error: /usr/lib64/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory failed to load driver: kms_swrast gbm: failed to open any driver (search paths /usr/lib64/dri) gbm: Last dlopen error: /usr/lib64/dri/swrast_dri.so: cannot open shared object file: No such file or directory failed to load swrast driver Could not initialize SDL - displayIndex must be in the range 0 - -1 (Did you set the DISPLAY variable?) [root@iZbp11irq8z6b1plo30y63Z trunk]# 什么意思?
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值