/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 不是符号链接

我该如何修复这个问题?

$ ls -lha /usr/local/cuda/lib64/libcudnn*
-rwxr-xr-x 1 root root 275M Jun 21 15:56 /usr/local/cuda/lib64/libcudnn.so
-rwxr-xr-x 1 root root 275M Jun 21 15:56 /usr/local/cuda/lib64/libcudnn.so.7
-rwxr-xr-x 1 root root 275M Jun 21 15:56 /usr/local/cuda/lib64/libcudnn.so.7.0.5
-rw-r--r-- 1 root root 268M Jun 21 15:56 /usr/local/cuda/lib64/libcudnn_static.a

$ sudo ldconfig
/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 is not a symbolic link

这导致 roslib 无法安装

$ sudo apt install libroslib-dev
[sudo] password for mona: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils containerd libllvm5.0 libpython-all-dev libxfont2 linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic linux-headers-4.13.0-45 linux-headers-4.13.0-45-generic
  linux-image-4.13.0-36-generic linux-image-4.13.0-45-generic linux-image-extra-4.13.0-36-generic linux-image-extra-4.13.0-45-generic python-all python-all-dev python-wheel runc ubuntu-fan
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libroslib0d librospack-dev librospack0d
The following NEW packages will be installed:
  libroslib-dev libroslib0d librospack-dev librospack0d
0 upgraded, 4 newly installed, 0 to remove and 108 not upgraded.
Need to get 128 kB of archives.
After this operation, 485 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 librospack0d amd64 2.2.5-3 [86.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 librospack-dev amd64 2.2.5-3 [11.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libroslib0d amd64 1.12.5-4 [22.3 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libroslib-dev amd64 1.12.5-4 [7,154 B]
Fetched 128 kB in 1s (87.5 kB/s)      
Selecting previously unselected package librospack0d:amd64.
(Reading database ... 410043 files and directories currently installed.)
Preparing to unpack .../librospack0d_2.2.5-3_amd64.deb ...
Unpacking librospack0d:amd64 (2.2.5-3) ...
Selecting previously unselected package librospack-dev.
Preparing to unpack .../librospack-dev_2.2.5-3_amd64.deb ...
Unpacking librospack-dev (2.2.5-3) ...
Selecting previously unselected package libroslib0d:amd64.
Preparing to unpack .../libroslib0d_1.12.5-4_amd64.deb ...
Unpacking libroslib0d:amd64 (1.12.5-4) ...
Selecting previously unselected package libroslib-dev.
Preparing to unpack .../libroslib-dev_1.12.5-4_amd64.deb ...
Unpacking libroslib-dev (1.12.5-4) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 is not a symbolic link

Setting up librospack0d:amd64 (2.2.5-3) ...
Setting up librospack-dev (2.2.5-3) ...
Setting up libroslib0d:amd64 (1.12.5-4) ...
Setting up libroslib-dev (1.12.5-4) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 is not a symbolic link

我有

/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.23.so is the dynamic linker, ignoring

    libcudnn.so.7 -> libcudnn.so.7.0.5

答案1

mona@Mona:/usr/local/cuda/lib64$ sudo rm libcudnn
mona@Mona:/usr/local/cuda/lib64$ sudo rm libcudnn.so.7
mona@Mona:/usr/local/cuda/lib64$ sudo ln libcudnn.so.7.0.5 libcudnn.so.7
mona@Mona:/usr/local/cuda/lib64$ sudo ln libcudnn.so.7 libcudnn.so
mona@Mona:/usr/local/cuda/lib64$ sudo ldconfig

相关内容