Trouble installing R packages

I’m trying to install the R package “sf” but I’m running into errors there that lead me to think I need to install classInt.

Running R 4.2.2 when I try

install.packages("sf")
configure: error: in `/tmp/RtmpNAKjgg/R.INSTALL224422399ca0/units':
configure: error: 
--------------------------------------------------------------------------------
  Configuration failed because libudunits2.so was not found. Try installing:
    * deb: libudunits2-dev (Debian, Ubuntu, ...)
    * rpm: udunits2-devel (Fedora, EPEL, ...)
    * brew: udunits (OSX)
  If udunits2 is already installed in a non-standard location, use:
    --configure-args='--with-udunits2-lib=/usr/local/lib'
  if the library was not found, and/or:
    --configure-args='--with-udunits2-include=/usr/include/udunits2'
  if the header was not found, replacing paths with appropriate values.
  You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/home/sage/R/x86_64-pc-linux-gnu-library/4.2/units’
Warning in install.packages :
  installation of package ‘units’ had non-zero exit status
ERROR: dependencies ‘classInt’, ‘units’ are not available for package ‘sf’
* removing ‘/home/sage/R/x86_64-pc-linux-gnu-library/4.2/sf’
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpFNjKdh/downloaded_packages’
> install.packages("classInt")
Installing package into ‘/home/sage/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/classInt_0.4-9.tar.gz'
Content type 'application/x-gzip' length 439500 bytes (429 KB)
==================================================
downloaded 429 KB

* installing *source* package ‘classInt’ ...
** package ‘classInt’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2  -c fish1.f -o fish1.o
make: gfortran: No such file or directory
make: *** [/usr/lib64/R/etc/Makeconf:192: fish1.o] Error 127
ERROR: compilation failed for package ‘classInt’
* removing ‘/home/sage/R/x86_64-pc-linux-gnu-library/4.2/classInt’
Warning in install.packages :
  installation of package ‘classInt’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpFNjKdh/downloaded_packages’

When I try to install classInt in R it fails. I then tried to install both r-sf and r-classint with yay and both threw an error that was similar:

curl: (22) The requested URL returned error: 404
==> ERROR: Failure while downloading https://cran.r-project.org/src/contrib/e1071_1.7-12.tar.gz
    Aborting...
error: target not found: r-e1071
 -> error making: r-e1071

I ran yay -Syu and tried again and got the same thing. I’m not sure if it’s an issue with my R setup or my Manjaro or neither

You need to install the missing library. libudunits2.so is available in the AUR as udunits

This problem is has nothing to do with a missing classInt package.

install.packages("classInt")
...
make: gfortran: No such file or directory

This error means you don’t have the gfortran compiler installed. It is available in the Repo as gcc-fortran

Even if you fix these problems, new errors might accrue. You need to read the error messages more carefully.

There is no resemblance with the other errors. It just means that the packages r-e1071 needs to be updated by the maintainer. It is out of date.

1 Like

Not that I know anything about R
but the error says that you need

AUR (en) - udunits

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.