Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install sf failed I have libgdal.so.30 instead of libgdal.so.29 (ubunutu) #1918

Closed
defuneste opened this issue Mar 8, 2022 · 4 comments
Closed

Comments

@defuneste
Copy link

defuneste commented Mar 8, 2022

Hello,

I am on Ubuntu 20.04.4 LTS. I followed this instruction:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev 

Then I get:

gdal-config --version
# 3.4.0
proj
#Rel. 8.2.0, November 1st, 2021
#usage: proj [-bdeEfiIlmorsStTvVwW [args]] [+opt[=arg] ...] [file ...]

It seems good then I try to install sf:

library(remotes)
install_github("r-spatial/sf")

I get this error message:

checking GDAL: checking whether PROJ is available fur running:... ./gdal_proj: error while loading shared libraries: libgdal.so.29: cannot open shared object file: No such file or directory
no
configure: error: OGRCoordinateTransformation() does not return a coord.trans: PROJ not available?

I think libgdal should be the 29:

dpkg -l | grep gdal  
# ii  gdal-data                                  3.4.0+dfsg-1~focal0                   all          Geospatial Data Abstraction Library - Data files
# ii  libgdal-dev                                3.4.0+dfsg-1~focal0                   amd64        Geospatial Data Abstraction Library - Development files
# ii  libgdal30                                  3.4.0+dfsg-1~focal0                   amd64        Geospatial Data Abstraction Library

If I try to remove the ppa and retry.

@edzer
Copy link
Member

edzer commented Mar 8, 2022

If I try to remove the ppa and retry.

please finish issues before you send them. It sounds like you have multiple versions of one of the libraries, possibly GDAL, on your system, installed. That is not going to work.

@defuneste
Copy link
Author

I think I have only one GDAL: see `dpkg -l |grep gdal. Anaconda have some version of gdal but it should not matter?

I started with what I thought to be a clean setup removing, every possible GDAL and PROJ that I could find.

I used:

sudo apt remove libgdal-dev
sudo apt remove libproj-dev
sudo apt remove gdal-bin
sudo apt autoremove

and checked package with:

dpkg -l | grep gdal
dpkg -l | grep proj

Should I do more?

please finish issues before you send them.

Sorry I will try.

I have then removed GDAL and PROJ and checked with "dpkg -l". Removed the unstable unbutugis PPA and added the stable one.

sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev 
proj
#Rel. 7.2.1, January 1st, 2021
#usage: proj [-bdeEfiIlmorsStTvVwW [args]] [+opt[=arg] ...] [file ...]
gdal-config --version
# 3.3.2

Then in R:

library(remotes)
install_github("r-spatial/sf")

it passes this check now:

checking GDAL: checking whether PROJ is available fur running:... yes

but later I have an other error:

Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/defuneste/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-sf/00new/sf/libs/sf.so':
libproj.so.22: cannot open shared object file: No such file or directory
Error: loading failed

It sounds like you have multiple versions of one of the libraries, possibly GDAL, on your system, installed.

I will investigated that a bit more and I will read good documentation on how to be sure package and dependencies can be manage well.

@edzer
Copy link
Member

edzer commented Mar 8, 2022

libproj.so.22: cannot open shared object file: No such file or directory

might indicate duplicate PROJ installations.

@defuneste
Copy link
Author

Thanks!

It worked after:

  • a reboot
  • I used CRAN instead of Github
  • I was on ESS instead of Rstudio

No idea which one of those changes make it works. (should I close or do you close the issue?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants