I have been trying to install rgdal from RStudio Version 1.0.44 on ubuntu 16.04 then I was getting the gdal-config not found error. I resolved this by installing the libgdal1-dev & libproj packages but now i'm getting the following error. Someone help me resolve this.
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/hetch/R/x86_64-pc-linux-gnu-library/3.3/rgdal/libs/rgdal.so':
/usr/lib/x86_64-linux-gnu/libgeos_c.so.1: undefined symbol:_ZN4geos4geom18IntersectionMatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/hetch/R/x86_64-pc-linux-gnu-library/3.3/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
I have had some issues trying to install rgdal package but finally I succeeded.
My problem was that gdal > 2.0 is needed, and it does not ship with ubuntu 16.04 by default, so extra packages are needed.
I ended up installing the following packages:
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin python-gdal python3-gdal libgdal1-dev
Additionally, r > 3.3 is needed too, so I ended up updating ubuntu's default r-base installation like this:
sudo add-apt-repository 'deb https://cran.rediris.es/bin/linux/ubuntu xenial/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt update
Hope it works for you too.
For Rh6, you have just to install:
yum install proj-devel-4.8.0-4.1.x86_64.rpm
N.B: in my case, my server is not connected to internet, So I download the package from repo to my local machine and then I copied it to my server.
Related
I did not quite know where this belongs exactly, so I decided to post this here on stack overflow.
I recently had package issues with R and R-Studio on Linux Mint 20.1, where I always recieved dependency errors when installing packages like plotly and tidyverse. Therefore, in order to test if my system was responsible I live booted a fresh Linux Mint USB and installed R and R-Studio the following way:
sudo apt update
sudo apt dist-upgrade
sudo apt install r-base
Then download R-Studio from here and installed it like:
sudo apt-get install gdebi-core
# Install R-Studio with gdebi
sudo gdebi rstudio-1.2.5042-amd64.deb
Then, I opened RStudio by typing rstudio in the terminal. Inside RStudio I tried to install the package tidyverse by install.packages("tidyverse") which resulted in some dependency errors like:
ERROR: dependencies ‘xml2’, ‘httr’ are not available for package ‘rvest’
* removing ‘/home/mint/R/x86_64-pc-linux-gnu-library/3.6/rvest’
* installing *source* package ‘tibble’ ...
The solution was to use the command, suggested in the r-lib issue by #fredaas:
sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
By using this command I was able to resolve the issue and install every package I required flawlessly.
I am sorry if this does not belong here but I hope I can help someone saving hours of troubleshooting. This issues is maybe caused by Linux Mint or the most recent R Version 4.0.3 so I was not sure where to share my results.
I tried to install PKI library but got this error
ERROR: compilation failed for package ‘PKI’
when I already installed "openssl" and update package index
sudo apt-get update
sudo apt-get install libssl-dev
What else can I do to help install "PKI" library in R.
Thank you.
I'm using R 3.3.2 and Ubuntu 16.10. I'm unable to install rgl and rgdal packages.
When I use
install.packages("rgl")
gives the following error message:
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ‘rgl’
When I use
install.packages("rgdal")
gives the following error message:
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
Edited
When I use
sudo apt-get install r-cran-rgl
in Ubuntu Terminal, it says
r-cran-rgl is already the newest version (0.95.1441-2)
However, the latest version of rgl is 0.96.0.
When I use
sudo apt-get install libgdal-dev libgeos++-dev
it throws the following error:
The following packages have unmet dependencies:
libgdal-dev : Depends: libopenjp2-7-dev but it is not going to be installed
I found a solution that was useful for me here: http://robinlovelace.net/r/2013/11/26/installing-rgdal-on-ubuntu.html.
In short, the solution would be this tree command lines:
sudo apt-get install aptitude # install aptitude as an alternative to apt-get
sudo aptitude install libgdal-dev # install the package (you may have to respond to queries here)
sudo aptitude install libproj-dev # install the proj.4 projection library
For rgl, just do sudo apt-get install r-cran-rgl.
For rgdal, follow the recommendation of the spatial folks eg here for sf and do this
add ubuntugis-unstable to the package repositories (e.g. with sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable and then sudo apt-get install libgdal-dev libgeos++-dev)
For general 'R on Ubuntu or Debian' questions, go to the r-sig-debian list.
Edit: Note that you don't need need ubuntugis-unstable repo if the current/older libgdal, libproj4 versions are good enough for you. Those are in the Ubuntu distro so just do sudo apt-get install ....
These installations worked for me provided that, in addition, I installed libxerces-c28. The need for the related shared object was indicated in the error log the first time I tried, after doing the installations indicated (libgdal, libgdal-dev, etc)
I am trying out the examples mentioned in this link . I have successfully installed all the packages mentioned as the basic packages here.
When I try to use command gmap (given in the example as mymap <- gmap("France") i get the following problem:
> gmap("France")
Loading required namespace: rgdal
Failed with error: ‘there is no package called ‘rgdal’’
Error in gmap("France") : rgdal not available
Also I am aware that gmap command belongs to the package dismo. And I have successfully installed this package.
to install rgdal upgrade your R version to at least 3.5.0
https://cran.r-project.org/package=rgdal
I had the same trouble and was getting an error 'rgdal' was built under R version 3.1.3. when I was trying install.packages("rgdal"), and installation of package had non-zero exit status when trying install.packages('rgdal', type = "source")
But it worked just now, try again.
One of the reasons for this error is an outdated version of the core R package. On Ubuntu, for instance, this happens if the r-base package is installed from the universe repository.
The fix is to add the CRAN repository and install R from there:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base
I can't get RGDAL to install in R. I'm using Ubuntu 12.04.
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
I found some solutions which said to do this:
sudo apt-get install aptitude
sudo aptitude install libgdal-dev
sudo aptitude install libproj-dev
I follow these through, accepting 'yes' when prompted, but afterwards the same original error. It doesn't resolve it. I wonder whether I should be downgrading something perhaps?
Thanks, James.
First check that everything is up to date with:
sudo apt-get update
On a slight tangent - i usually also install and a few others (needed for libraries like tidyverse):
sudo apt-get install -y libxml2-dev libcurl4-openssl-dev libssl-dev
Then install Rgdal and proj.4 (you may have to click yes a few times):
sudo apt-get install libgdal-dev
sudo apt-get install libproj-dev