R - How to install "PKI" library in Ubuntu - r

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.

Related

R ERROR: dependencies ‘xml2’, ‘httr’ are not available for package (Linux Mint 20.1)

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.

how to install rstan in ubuntu 18.04

I'm trying to instal the rstan in Ubuntu 18.04. I started with
apt-get install r-cran-rstan
and it showed dependence on the packages : r-cran-ggplot2 , r-cran-pkgbuild and r-cran-v8.
Then while trying to install all of them, another dependence on r-api-3.5, which I tried to install with
apt-get install r-api-3.5
Then I saw the following message :
The r-api-3.5 package is a virtual package provided by: r-base-core
3.6.3-1bionic [Not a candidate version]
E: The 'r-api-3.5' package has no candidate for installation
I read some tutorials like this one: Not able to install rstanarm on Ubuntu 18.04 LTS saying I should add the ppa by doing :
sudo add-apt-repository -y "ppa:marutter/rrutter"
sudo add-apt-repository -y "ppa:marutter/c2d4u3.5"
sudo apt update
sudo apt install r-cran-rstanarm
and I did. But it's still not working. My R version is the latest one. I didn't find documentation about r-api-3.5 in Ubuntu. If anyone knows how to solve it, please tell me.
I ran into the same issue and my colleague as well.
We just jumped directly to the install and it worked fine.
In short:
remove.packages("rstan")
if (file.exists(".RData"))
file.remove(".RData")
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
library(rstan)
example(stan_model,run.dontrun = TRUE)
Source and more detailed explanation: https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#installation-of-rstan

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.

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)

RGDAL won't install

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

Resources