完美解决linux编译动态库出现的问题:ERROR: ld.so: object LD_PRELOAD cannot be preloaded: ignored

报错记录:

 apt update
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
0% [Waiting for headers] [Waiting for headers] [Waiting for headers] [Waiting for headers]ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease                                   
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                         
Hit:4 https://storage.googleapis.com/bazel-apt stable InRelease     
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                 
Hit:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease                                               
Ign:2 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  InRelease
Ign:5 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease
Hit:8 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  Release
Hit:9 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libadd_c.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Reading package lists... Done

解决方法参考:https://stackoverflow.com/questions/17723666/error-ld-so-object-ld-preload-cannot-be-preloaded-ignored
只需一行命令:

unset LD_PRELOAD

再次更新完美解决:

/usr/lib# unset LD_PRELOAD
root@ee356da1bbe1:/usr/lib# apt update
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                   
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                         
Hit:5 https://storage.googleapis.com/bazel-apt stable InRelease                                                                             
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                                       
Ign:1 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  InRelease
Hit:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:4 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease
Hit:8 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64  Release
Hit:10 https://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64  Release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.

你可能感兴趣的:(C/C++,Linux,ubuntu,linux)