Issues while installing RCurl - r

I am trying to install RCurl. But getting following error while installing:
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
So tried installing libcurl4-openssl-dev on my Redhat 6 server.
But getting
No package libcurl4-openssl-dev available.
I have already installed curl and libcurl-devel.

Related

error in install.packages 'rgdal': gdal-config not found - configure argument error

I am trying to install rgdal package in rstudio. I am using centos8. I have already installed:
sudo yum install gdal gdal-devel
sudo yum install geos geos-devel
I have also tried to install using:
install.packages('rgdal', type = "source", configure.args=c(
'--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config',
'--with-proj-include=/Library/Frameworks/PROJ.framework/Headers',
'--with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'))
My error message:
configure: error: gdal-config not found - configure argument error.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/motipai/R/x86_64-redhat-linux-gnu-library/4.0/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp5jeQl8/downloaded_packages’
installing first in terminal:
sudo yum install gdal.x86_64 gdal-devel.x86_64 gdal-libs.x86_64
sudo yum install proj.x86_64 proj-devel.x86_64
and then in r console:
install.packages("rgdal")
Solves the probem.

ERROR: compilation failed for package ‘xml2’

I am installing "rvest" and "xml2" packages in Ubuntu 16.04. But on multiple times i am getting the error as below
/usr/lib/R/etc/Makeconf:143: recipe for target 'connection.o' failed
make: *** [connection.o] Error 1
ERROR: compilation failed for package ‘xml2’
* removing ‘/home/prdmcl/R/x86_64-pc-linux-gnu-library/3.2/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
I checked multiple sources and did this also
sudo apt-get install libcurl4-openssl-dev libssl-dev
sudo apt-get install libxml2-dev
But failed to install.
Seems to be a specific problem with your system(mainly with C++), not with the package.
I had the same problem, and I used this workaround on R command line :
withr::with_makevars(c(CXX = "g++ -std=c++11"),install.packages("xml2", verbose = TRUE))
This will install xml2. After that, you can install rvest package

Problem installing Sodium package in R on an Ubuntu system

I am trying to install a package called sodium in R on an Ubuntu system but I'm getting an error message like the following:
install.packages("sodium", dependencies = T)
...
* installing *source* package ‘sodium’ ...
** package ‘sodium’ successfully unpacked and MD5 sums checked
Package libsodium was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsodium.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsodium' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lsodium
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libsodium was not found. Try installing:
* deb: libsodium-dev (Debian, Ubuntu, etc)
* rpm: libsodium-devel (Fedora, EPEL)
* csw: libsodium_dev (Solaris)
* brew: libsodium (OSX)
If libsodium is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libsodium.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘sodium’
* removing ‘/R/x86_64-pc-linux-gnu-library/3.4/sodium’
Warning in install.packages :
installation of package ‘sodium’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmph70q7Q/downloaded_packages’
The following code didn't install it either.
install.packages("libsodium-dev", dependencies = T)
Warning in install.packages :
package ‘libsodium-dev’ is not available (for R version 3.4.4)
I also tried install_github but still get an error:
devtools::install_github("jedisct1/libsodium")
Error: Failed to install 'unknown package' from GitHub:
Timeout was reached: [api.github.com] Resolving timed out after 10000 milliseconds
Any idea on how to install this package?
I wish installing packages on an Ubuntu R was as error free as doing it on Windows R.
If someone could teach me how to avoid package installing errors in Ubuntu R, it'd be great.
You need to install libsodium-dev, some software for your computer that isn't necessarily R specific.
You can do this via your terminal in linux. Go to your terminal and execute
sudo apt install libsodium-dev
Then go back to R and install the package with the usual command
devtools::install_github("jedisct1/libsodium")

Unable to install Quandl under R version 3.2?

I'm running R version 3.2 because it is a requirement for ggplots2.
However it seems that I cannot install package "Quandl".
I'm getting the following warnings:
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
and some others. The result is:
Warning in install.packages :
installation of package ‘Quandl’ had non-zero exit status
My assumption is that the newer R version is not yet supported by the required dependency.
What should I do?
You need to install libcurl4-openssl-dev operating system package. You can use this command on Debian-based OS (including Ubuntu and Mint):
sudo apt-get install libcurl4-openssl-dev

installation of package ‘devtools’ had non-zero exit status on Ubuntu

I'm trying to install devtools in a PowerPC with a R version 3.1.1 but failed at the end because the curl library:
...
** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/path
to/R/powerpc-unknown-linux-gnu-library/3.1/curl/libs/curl.so': /path
to/R/powerpc-unknown-linux-gnu-library/3.1/curl/libs/curl.so:
undefined symbol: BSWAP_32 Error: loading failed Execution halted
ERROR: loading failed
* removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/curl’ ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/httr’ ERROR: dependency ‘curl’ is not available for package ‘rversions’
* removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/rversions’ ERROR:
dependencies ‘httr’, ‘rversions’ are not available for package
‘devtools’
* removing ‘/path to/R/powerpc-unknown-linux-gnu-library/3.1/devtools’
The downloaded source packages are in
‘/tmp/RtmpD0yE63/downloaded_packages’ Warning messages: 1: In
install.packages("devtools") : installation of package ‘curl’ had
non-zero exit status 2: In install.packages("devtools") :
installation of package ‘httr’ had non-zero exit status 3: In
install.packages("devtools") : installation of package ‘rversions’
had non-zero exit status 4: In install.packages("devtools") :
installation of package ‘devtools’ had non-zero exit status
I've already installed libcurl4-gnutls-dev and libcurl4-openssl-dev and the libcurl version is 7.38.0.
Does anyone know a fix to this? Thanks ;)
The same problem happened to me when I was trying to install "devtools" package on a new machine with Ubuntu 16.04 system.
I tried many answers including the adopted one above, but I still couldn't solve the problem until I noticed another warning information "(as ‘lib’ is unspecified)". Then I realized that I was running R as a normal user while the R base is installed by root. It means the package "devtools" couldn't be installed into the default R library folder and possibly couldn't use some dependent packages. Then the solution became very easy: run R as root user and then install "devtools".
Following the instructions of Dean Attali (https://www.digitalocean.com/community/tutorials/how-to-set-up-r-on-ubuntu-14-04), I summarize the steps below. Just run them in a terminal.
$ sudo apt-get -y install libcurl4-gnutls-dev libxml2-dev libssl-dev
$ sudo su
$ R
> install.packages('devtools', repos='http://cran.rstudio.com/')
That's it. Since the package is installed by root, it can be used by all users of the system.
For Curl use:
apt-get -y build-dep libcurl4-gnutls-dev
apt-get -y install libcurl4-gnutls-dev
And you should update the R version to R-3.1.2
wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz
I m using Ubuntu 16.04 and this is how I solved this issue:
aptitude install libssl-dev
then aptitude packg manage will allow you to choose the right version which is required for installation of devtools.
Repeat the same for
aptitude libcurl4-gnutls-dev
aptitude libxml2-dev
Finally, install this libgit2 lib
devtools::install_github('ropensci/git2r')
devtools::load_all()
R CMD INSTALL git2r
I could not solve it with apt-get packg manager. Thats all :) !
This error was happening when I was using 3.0.2. I updated the R, now It is fine. I also spent the one day to find the solution. I tried the all the solution. But, no effect. I updated the R using this solution. Now, devtools package is working.
Fedora 34
What did it for me was:
sudo dnf groupinstall "Development tools"
Not sure about that, but also:
sudo dnf install freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel
Don't know, don't care, but it worked!

Resources