Install qgis 1.6.0 error due to newer netcdf package - Ubuntu 10.10

Asked by Chethan S. on 2011-03-09

I have been trying to install qgis 1.6.0 from source since two days now. I get the following error every time:

/usr/bin/ld: warning: libnetcdf.so.4, needed by /usr/local/lib/libgdal.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libgdal.so: undefined reference to `nc_inq_vartype'
/usr/local/lib/libgdal.so: undefined reference to `nc_put_att_double'
/usr/local/lib/libgdal.so: undefined reference to `nc_strerror'
/usr/local/lib/libgdal.so: undefined reference to `nc_get_vara_uchar'
/usr/local/lib/libgdal.so: undefined reference to `nc_put_att_short'
.
.
.
/usr/local/lib/libgdal.so: undefined reference to `nc_put_vara_double'
/usr/local/lib/libgdal.so: undefined reference to `nc_inq_varname'
/usr/local/lib/libgdal.so: undefined reference to `nc_open'
collect2: ld returned 1 exit status
make[2]: *** [src/app/qgis] Error 1
make[1]: *** [src/app/CMakeFiles/qgis.dir/all] Error 2
make: *** [all] Error 2

I use Ubuntu 10.10 64-bit and also have GRASS GIS installed. I have also tried after installing libnetcdf-dev and libnetcdf6 packages but no luck. When I try to invoke any gdal module in GRASS I get a similar error:

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

However I don't face any issues in my another desktop at college where I use Ubuntu 10.04 LTS. I later found that in LTS version it is still the older build of libnetcdf, i.e., 1:3.6.3-1 whereas in 10.10 it is the newer version 1:4.1.1-5.

Therefore, I would suggest you provide the option of installing the older version from the synaptic as well.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu qgis Edit question
Assignee:
No assignee Edit question
Solved by:
Chethan S.
Solved:
2011-03-10
Last query:
2011-03-10
Last reply:
2011-03-10

You can get qgis 1.6 with:

sudo add-apt-repository ppa:jef-norbit/qgis-unstable-ubuntugis-jef; sudo apt-get update; sudo apt-get --reinstall install qgis

Does that solve the issue?

Chethan S. (chethan) said : #2

That particular PPA has an older version of qgis - 1.5. Again getting qgis via ppa won't be difficult since there is ubuntu-gis ppa also. But they have grass as a dependency again. I however use a svn version of grass. So all these problems have arisen.

Chethan S. (chethan) said : #4

I am really sorry, I did a direct search on google and had landed on the page for qgis-stable ppa of same person.

Let me check it once I go home.

Chethan S. (chethan) said : #5

As you suggested I added the above PPA and tried installing qgis. But now I get more errors:

chethan@chethan-desktop:~$ sudo apt-get install qgis
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 qgis : Depends: libgdal1-1.7.0 but it is not installable
        Depends: libgeos-c1 (>= 3.2.2) but 3.2.0-1 is to be installed
        Depends: libqgis1.6.0 but it is not going to be installed
        Depends: qgis-providers (= 1.6.0-3~maverick1) but it is not going to be installed
        Recommends: qgis-plugin-grass but it is not going to be installed
        Recommends: python-qgis but it is not going to be installed
E: Broken packages

Try:

sudo apt-get -f install

Chethan S. (chethan) said : #7

chethan@chethan-desktop:~$ sudo apt-get -f install qgis
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 qgis : Depends: libgdal1-1.7.0 but it is not installable
        Depends: libgeos-c1 (>= 3.2.2) but 3.2.0-1 is to be installed
        Depends: libqgis1.6.0 but it is not going to be installed
        Depends: qgis-providers (= 1.6.0-3~maverick1) but it is not going to be installed
        Recommends: qgis-plugin-grass but it is not going to be installed
        Recommends: python-qgis but it is not going to be installed
E: Broken packages

No, run:

sudo apt-get -f install

Not:

sudo apt-get -f install qgis

Chethan S. (chethan) said : #9

Also somehow if I install qgis using these routes, I am sure I won't be able to use gdal tools in GRASS GIS svn version what I am using since there again I get errors like:

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

Chethan S. (chethan) said : #10

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libsm-dev libva-x11-1 libice-dev libxrandr-dev libexpat1-dev fftw2
  libxfixes-dev libqt3-headers x11proto-xinerama-dev x11proto-render-dev
  libxi-dev libiso9660-7 libcddb2 libfontconfig1-dev liblcms1-dev
  libmpich1.0gf x11proto-randr-dev libdvbpsi6 libxinerama-dev
  libterm-readline-gnu-perl libx264-98 libsdl-image1.2 x11proto-fixes-dev
  libupnp3 x11proto-xext-dev libxt-dev libxmu-dev libmatroska2 libxext-dev pdl
  libcups2-dev libqwt4c2 libqt3-compat-headers libfreetype6-dev qt3-dev-tools
  libcsiro0 libaudio-dev libxmu-headers libxrender-dev libopengl-perl
  libxft-dev libtar libplplot9 libqt3-mt-dev libmng-dev libvcdinfo0 libebml2
  libqhull5 freeglut3 libxcursor-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

ok you can clean that using:

sudo apt-get --purge autoremove; sudo apt-get -y upgrade; sudo apt-get clean

Can you also give the output of:

ls /usr/lib/libnetcdf*

Thanks

i alway use this method to install qgis into Ubuntu http://www.qgis.org/wiki/Download#Ubuntu

Chethan S. (chethan) said : #14

Required output:
chethan@chethan-desktop:~$ ls /usr/lib/libnetcdf*
/usr/lib/libnetcdf.a /usr/lib/libnetcdff.so
/usr/lib/libnetcdf_c++.a /usr/lib/libnetcdff.so.5
/usr/lib/libnetcdf_c++.so /usr/lib/libnetcdff.so.5.0.0
/usr/lib/libnetcdf_c++.so.5 /usr/lib/libnetcdf.so
/usr/lib/libnetcdf_c++.so.5.0.0 /usr/lib/libnetcdf.so.6
/usr/lib/libnetcdff.a /usr/lib/libnetcdf.so.6.0.0

@Marco I used to use that method before, but now since I am using SVN Version of GRASS I can't install only QGIS from that PPA. It requires me to install GRASS from PPA as well.

try:

sudo ln -s /usr/lib/libnetcdf.so.6 /usr/lib/libnetcdf.so.4

Then retry

FYI i have (on 3 ubuntu 10.04.2 32 bits pc at work, not here) official qgis plus the svn trunk that i compile and use every day...

Chethan S. (chethan) said : #17

I have got past that error and am solving other dependency issues and moving forward with 'make'. Now I am sure things will work as expected.

@Marco I was able to install QGIS from source in my college PC running Ubuntu 10.04.2 64-bit without any issues, but here at home I have Ubuntu 10.10 64-bit. Yesterday I had discovered that in LTS version it is still the older build of libnetcdf, i.e., 1:3.6.3-1 whereas in 10.10 it is the newer version 1:4.1.1-5.

So please try to create symbolic link as actionparsnip suggest to you...

i'm trying here @home on a 10.10 installed qgis right now and i have no issue

dpkg -l | grep -i libnetcdf

ii libnetcdf6 1:4.1.1-5 An interface for scientific data access to large binary data

 apt-cache policy libnetcdf6
libnetcdf6:
  Installato: 1:4.1.1-5
  Candidato: 1:4.1.1-5
  Tabella versione:
 *** 1:4.1.1-5 0
        500 http://archive.ubuntu.com/ubuntu/ maverick/universe i386 Packages
        100 /var/lib/dpkg/status

 lsb_release -c
Codename: maverick

apt-cache policy grass
grass:
  Installato: 6.4.0-2~maverick1
  Candidato: 6.4.0-2~maverick1
  Tabella versione:
 *** 6.4.0-2~maverick1 0
        500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu/ maverick/main i386 Packages
        100 /var/lib/dpkg/status
     6.4.0~rc6+42329-1 0
        500 http://archive.ubuntu.com/ubuntu/ maverick/universe i386 Packages

Chethan S. (chethan) said : #20

Sorry, this is not related to the question above but I thought its worth posting since I get in my process of running 'make':

[ 86%] Built target wfsplugin
Linking CXX shared module libgeorefplugin.so
c++: /usr/bin/gsl-config:: No such file or directory
c++: not: No such file or directory
c++: found: No such file or directory
make[2]: *** [src/plugins/georeferencer/libgeorefplugin.so] Error 1
make[1]: *** [src/plugins/georeferencer/CMakeFiles/georefplugin.dir/all] Error 2
make: *** [all] Error 2

As per the output I obtained for;
chethan@chethan-desktop:~$ apt-file search gsl-config
libgsl0-dev: /usr/bin/gsl-config
libgsl0-dev: /usr/share/man/man1/gsl-config.1.gz
lush-library: /usr/share/lush/packages/gsl/gsl-config.lsh

I have installed libgsl0-dev and lush-library. Still the error persists. Any idea why it is so?

is this the very first time you try to compile grass from svn on this pc ?

Please try to install/reinstall libgsl0-dev

from terminal type:

sudo apt-get --reinstall install libgsl0-dev build-essential

Then also check the file is in the requested path type:

ls -la /usr/bin/gsl-config

Chethan S. (chethan) said : #23

No this is not the first time.

I get the same error again.

The file appears to be in the right path
-rwxr-xr-x 1 root root 1239 2010-05-10 06:11 /usr/bin/gsl-config

try

sudo ldconfig

Chethan S. (chethan) said : #25

No luck. Again its the same.

Since you are referring to Grass you can chieve better answer by asking on http://www.ces.iisc.ernet.in/grass/devel/index.php#compile

Chethan S. (chethan) said : #27

Not grass. Its all qgis problems. I had mentioned grass just to say that I use grass along with qgis. Since actionparsnip suggested me to install qgis from ppa I had mentioned about problems I might face with gdal tools in grass - libnetcdf.so.4 error.

http://www.qgis.org/wiki/Building_QGIS_from_Source

please consider to use the ccmake utility

i must go to bed now tomorrow i will post here my ccmake command line to compile the sources...

Chethan S. (chethan) said : #29

Ok sir, no issues. Even I have to leave for college. Will check it in the evening.

Chethan S. (chethan) said : #30

This trick worked. I ran 'make clean' and then ran 'ccmake .' followed by 'make' and 'sudo make install'. I received no errors in the process. Now QGIS works fine.

Thanks a lot @actionparsnip and @Marco for your timely guidance.

I'd say this was Marco's ;)

Way to go duder.

Glad you got the gold too :)