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

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.

Related

Installing R `sf` and `RPostgres` packages on Unbuntu 18.04.4

Desire is to installed R {sf} and {RPostgres} packages on Ubuntu 18.04.4.
Trying:
R$> install.packages("sf")
configure: error: gdal-config not found or not executable.
Some SO searching (eg https://stackoverflow.com/a/49181048/2802810) suggests this:
sh$> sudo apt-get install libgdal-dev
The following packagess have unmet dependencies: libpq-dev :
Depends: libpq5 (= 10.12-0Ubuntu0.18.04.1) but 12.3-1.pgdg18.04+1 is
to be installed E: Unable to correct problems, you have broken
packages.
I also need libpq-dev for R {RPostgres}.
You may want to add PPA, depending on your R version.
https://launchpad.net/~marutter/+archive/ubuntu/c2d4u
https://launchpad.net/~marutter/+archive/ubuntu/c2d4u3.5
https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+
After adding PPA, you can install using sudo apt install r-cran-sf and sudo apt install r-cran-rpostgres
OKaaaay. The box I'm working in didn't have a Postgres repo installed (https://www.postgresql.org/download/linux/ubuntu/). Never libpq libs and that was all it needed.

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.

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)

Install particular version(2.15.2) of r-base on ubuntu

I am newbie to both Ubuntu and R.
I am trying to install R 2.15.2 on ubuntu. Since the latest version of R is 3.0.X, I specified the version in /etc/apt/sources.list
deb http://cran.ma.imperial.ac.uk/bin/linux/ubuntu precise 2.15.2
Then I ran sudo apt-get install r-base.
It installs, but when I check version, it is 2.14.1, not 2.15.2
I tried to specify version in command line, such as:
sudo apt-get install r-base_2.15.2_1precision1
Always seeing:
E: Unable to locate package r-base_2.15.2_1precision1.
E: Couldn't find any package by regex 'r-base_2.15.2_1precision1'
Any suggestion? Thanks.
If I run command:
sudo apt-get install r-base=2.15.2-1precise0
See the following message:
The following packages have unmet dependencies:
r-base : Depends: r-recommended (= 2.15.2-1precise0) but 3.0.1-1precise0precise2 is to be installed
Recommends: r-base-html but it is not going to be installed
Find the solution.
I need to install like:
sudo apt-get install r-base-core=2.15.3-1precise0precise1
sudo apt-get install r-recommended=2.15.3-1precise0precise1
sudo apt-get install r-doc-html=2.15.3-1precise0precise1
sudo apt-get install r-base=2.15.3-1precise0precise1
Okay so the URL for where the packages are found has changed :^) on the cran.ma site:
Change the debian url to:
deb http://cran.ma.imperial.ac.uk/bin/linux/ubuntu precise/
do an apt-get update and try reinstalling
The complete instructions are on:
http://cran.ma.imperial.ac.uk/bin/linux/ubuntu/

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