All of my apt-get operations are failing, because somewhere there seems to be a file calling ld.so with a file that no longer exist. This means I can no longer use apt-get to install or update my dependencies!
I'm running Lubuntu 16.04.
I believe this started to occur because of an auto-update that occurred with Nvidia CUDA. Starting last week, I started seeing this line show up in my terminal after running commands that have nothing to do with CUDA.
ERROR: ld.so: object '/usr/lib/nvidia-375/libnvidia-ml.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
I went to look into this and found that the file /usr/lib/nvidia-375/libnvidia-ml.so did not exist on my system, that instead there was a libnvidia-ml.so file in a folder that seemed to be for an update of the same package, /usr/lib/nvidia-382.
I thought that with a reboot and some updates this problem would go away, but today I realize that I can no longer do most apt-get commands. For example, when I run an install command, I get a huge log output, that includes the above line hundreds of times, and the installation ultimately fails.
I've copy-and-pasted one of those outputs into a gist (it was too big to put inside this post). This was the result from output from trying to run sudo apt-get install vlc
(but it fails similarly with any install). https://gist.github.com/travellingprog/00a08cff1019f7a12d36b975dff62c92
I don't even use CUDA these days, so this is especially annoying. One of the things I tried was to uninstall nvidia-382. The uninstallation itself seems to have worked, and it seems to have removed CUDA 9 along with it, but the problem still persists.
The thing is I have no idea what package or file keeps asking for this non-existing file in /usr/lib/nvidia-375.
Can someone please help?
Update 2017-11-01
I seem to get this error anytime I run a sudo
command.
I tried running ldd /usr/bin/sudo
and ldd /usr/bin/apt-get
and neither of them list this Nvidia file. I looked in the folder /etc/ld.so.conf.d and found a file called cuda-9-0.conf, despite the fact that CUDA should be removed. So I renamed it to cuda-9-0.backup and ran sudo ldconfig
.
This didn't fix it, I still get the error message on every sudo
command.
I also decided to check the cache, and I'm not sure if this is pointing to the issue:
# sudo ldconfig -p | grep nvidia
ERROR: ld.so: object '/usr/lib/nvidia-375/libnvidia-ml.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
libnvidia-gtk3.so.384.81 (libc6,x86-64) => /usr/lib/libnvidia-gtk3.so.384.81
libnvidia-gtk2.so.384.81 (libc6,x86-64) => /usr/lib/libnvidia-gtk2.so.384.81
sudo apt purge $PACKAGE_NAME
? Sometimes it helps if files aren't properly removed to install the package again first (egsudo apt-get install --reinstall $PACKAGE_NAME
) and then to purge the package. I often then uselocate -i $BINARY_NAME
to find anything left over that needs manually deleting.