libnetcdf.so.11 not found (needed by eg ncview)

Asked by Timothy Williams on 2018-01-03

I am using ubuntu 16.04 LTS.

I am trying to install ncview, netcdf-bin and python-netcdf4 with apt-get install.

If I then try to use ncview I get the error:

ncview: error while loading shared libraries: libnetcdf.so.11: cannot open shared object file: No such file or directory

Similar error from ncdump (netcdf-bin)
and in python if I do
import netCDF4 (python-netcdf4)
I get
ImportError: libnetcdf.so.11: cannot open shared object file: No such file or directory

In /usr/lib/ I have:
/usr/lib/x86_64-linux-gnu/libnetcdf.so -> libnetcdf.so.11
but this is a bad link since libnetcdf.so.11 doesn't exist

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Timothy Williams
Solved:
2018-01-03
Last query:
2018-01-03
Last reply:
2018-01-03
Manfred Hampl (m-hampl) said : #1

For diagnostic purposes please provide the output of the following commands:

uname -a
lsb_release -crid
sudo dpkg --audit
dpkg -l | grep netcdf
ls -l /usr/lib/x86_64-linux-gnu/libnetcdf*

Timothy Williams (tdcwilliams) said : #2

uname -a
Linux vienna 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

sudo dpkg --audit
dpkg -l | grep netcdf
ii libnetcdf-c++4-1 4.2.1-3 amd64 C++ interface for scientific data access to large binary data
ii libnetcdf-c++4-dev 4.2.1-3 amd64 creation, access, and sharing of scientific data in C++
ii libnetcdf-dev 1:4.4.0-2 amd64 creation, access, and sharing of scientific data
ii libnetcdf11 1:4.4.0-2 amd64 Interface for scientific data access to large binary data
ii netcdf-bin 1:4.4.0-2 amd64 Programs for reading and writing NetCDF files
ii python-netcdf4 1.2.2-2 amd64 Python interface to the netCDF4 (network Common Data Form) library

ll libnetcdf*
-rw-r--r-- 1 root root 904904 jan. 22 2016 libnetcdf_c++4.a
lrwxrwxrwx 1 root root 23 jan. 22 2016 libnetcdf_c++4.so -> libnetcdf_c++4.so.1.0.2
lrwxrwxrwx 1 root root 23 jan. 22 2016 libnetcdf_c++4.so.1 -> libnetcdf_c++4.so.1.0.2
-rw-r--r-- 1 root root 327936 jan. 22 2016 libnetcdf_c++4.so.1.0.2
-rw-r--r-- 1 root root 913 mars 29 2016 libnetcdf.settings
lrwxrwxrwx 1 root root 15 mars 29 2016 libnetcdf.so -> libnetcdf.so.11

the last link is failing since libnetcdf.so.11 is not present.

Manfred Hampl (m-hampl) said : #4

Try reinstalling libnetcdf11 with the command

sudo apt-get install --reinstall libnetcdf11

Timothy Williams (tdcwilliams) said : #5

Thanks Manfred and Andrew.

I did:
sudo apt-get remove libnetcdf11 libnetcdf-dev netcdf-bin python-netcdf4 libnetcdf-c++4-dev libnetcdf-c++4-1
sudo apt-get install libnetcdf11 libnetcdf-dev netcdf-bin python-netcdf4 libnetcdf-c++4-dev libnetcdf-c++4-1 nco ncview

and python (import netCDF4), ncdump and ncview all work now.