RGDAL won't install - r

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

Related

error installing "rgl" package, version 0.100.19 in anaconda/jupyter-notebook. Ubuntu 18.04

I like to install "rgl" package version 0.100.19 (since the other package depends on this version) in anaconda/jupyter notebook environment and received error.
configure: error: X11 not found but required, configure aborted
I tried
sudo apt-get install xorg
sudo apt-get install libx11-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install r-cran-rgl
conda install -c conda-forge xorg-libx11
conda install -c anaconda mesa
but, they did not help yet.
install.packages("rgl")
configure: error: X11 not found but required, configure aborted
I came across this problem, my solution was to:
$ conda install r-rgl
It seems like the conda install goes to the conda R (see this with which R), and the way I found to get rgl installed on conda's R version was via conda install.

R - How to install "PKI" library in Ubuntu

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.

ubuntu "you have held broken packages"

(using ubuntu 14.04.3)
i need to install libx32gcc-4.8-dev libc6-dev-i386.
when i try to download it by writing:
sudo apt-get install libx32gcc-4.8-dev libc6-dev-i386
the terminal returns:
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:
libx32gcc-4.8-dev : Depends: lib32gcc1 (>= 1:4.8.4-2ubuntu1~14.04.3) but it is not going to be installed
Depends: libx32gcc1 (>= 1:4.8.4-2ubuntu1~14.04.3) but it is not going to be installed
Depends: lib32asan0 (>= 4.8.4-2ubuntu1~14.04.3) but it is not going to be installed
Depends: libx32asan0 (>= 4.8.4-2ubuntu1~14.04.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.`
and it doesn't work.
i have tried
sudo apt-get upgrade
sudo apt-get install libx32gcc-4.8-dev libc6-dev-i386
same result
and
sudo apt-get remove libx32gcc-4.8-dev libc6-dev-i386
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get install libx32gcc-4.8-dev libc6-dev-i386
but it doesn't work either...
i think you have to fix the packages by doing this
sudo apt-get install -f

Installing rgl and rgdal packages in R 3.3.2 on Ubuntu 16.10

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)

re- installing R linux ubuntu: unmet dependencies R

I used aptitude install to install a package, Ubuntu 11.10 oneiric, that apparently I couldn't install because of dependencies. I removed a couple of more libraries while doing it. I uninstalled Rstudio but still can't install R on my machine. I'm on ubuntu and this is what I get while running
sudo apt-get install r-base
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 2.15.3-1quantal0) but it is not going to be installed
Depends: r-recommended (= 2.15.3-1quantal0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
any ideas how to start from scratch and get R running again?
More of the Error log:
The following packages have unmet dependencies r-base-core : Depends: libblas3 but it is not installable or libblas.so.3 but it is not installable or libatlas3-base but it is not installable Depends: libc6 (>= 2.15) but 2.13-20ubuntu5.3 is to be installed Depends: liblapack3 but it is not installable or liblapack.so.3 but it is not installable or libatlas3-base but it is not installable Depends: liblzma5 (>= 5.1.1alpha+20120614) but it is not installable –
Try this
If you have added a line from new ubuntu repository to /etc/apt/sources.list, erase the line.
Then, run the commands
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get upgrade
It worked for me, the answer comes from here
http://r.789695.n4.nabble.com/Upgrading-on-Ubuntu-from-2-11-1-to-2-15-1-td4636965.html
Uninstall previous R installation:
sudo R --no-save
pkgList <- installed.packages(priority='NA')
remove.packages(pkgList)
q()
sudo apt-get remove --purge r-cran* r-base*
Follow instructions (for R part) from:
How to install R, JGR and Deducer in Ubuntu
To list what you installed with aptitude type the following
xyz#sxyzcom~$ sudo apt-get remove
This should list what remains of your R install and possibly anything else missing dependencies Then you can run
xyz#sxyzcom~$ sudo apt-get autoremove
and that should get you back to square one.
If you are facing problems regarding Broken packages then first of all remove that package by first checking dependencies and then forcefully remove that package, and don't ever forget to reboot when you do make enormous changes in your system. To remove that package use these shell commands
$ sudo su
Then Enter your password
# apt-cache rdepends package-name
# apt-get --purge remove --force package-name
Use these shell commands
# apt-get clean
# apt-get autoclean
# apt-get update
# apt-get upgrade
# apt-get dist-upgrade
# reboot
This worked for me, Try this, I believe this will fix all your problems, Good luck.
If you want to remove the package forcefully,you can do
sudo dpkg --remove --force-remove-reinstreq package_name
and then
sudo apt-get update

Resources