Linux – Missing package `udunits2` on CentOS

amazon ec2centoslinux

I'd like to use gganimate, but it requires the package sf.

I tried to install, but I get this error.

configure: error: in `/tmp/RtmpEpee0m/R.INSTALL282e663ea13f/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/User/R/x86_64-pc-linux-gnu-library/3.5/units’

I'm on CentOS hosted on EC2 and I'm unable to install libudunits2.so.

I've tried

sudo yum install udunits2-dev
sudo yum install udunits2-devel
sudo yum install udunits2
sudo yum install libcairo2-devel libjpeg8-devel libpango1.0-devel libgif-devel build-essential g++
sudo yum install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

For each of those commands, I get back No package available

Best Answer

The correct package name is udunits2-devel and as the output you posted indicates, it is in the EPEL repository.

Before you can install this package, you need to enable EPEL on your system. Do this by installing the epel-release RPM:

sudo yum install epel-release

After it is installed, then you can install udunits2-devel.