sudo 添加配置环境变量
sudo –preserve-env=HOME /usr/bin/env
Finally you can also set environment variables directly in the sudo command, like this:
sudo ZEBRA=true /usr/bin/env
sudo LD_LIBRARY_PATH=/opt/intel/mkl/lib/ia32:$LD_LIBRARY_PATH LD_PRELOAD=/opt/intel/mkl/lib/ia32/libmkl_core.so python -c “import numpy”