How to fix RcppGSL installation error gsl-config: Command not found


While trying to install RcppGSL using


you see the following error message:

checking for gcc option to accept ISO C89... none needed
checking for gsl-config... no
configure: error: gsl-config not found, is GSL installed?
ERROR: configuration failed for package ‘RcppGSL’
* removing ‘/usr/local/lib/R/site-library/RcppGSL’

The downloaded source packages are in
Warning message:
In .inet_warning(msg) :
  installation of package ‘RcppGSL’ had non-zero exit status


You need to install the libgsl2 development headers which include the gsl-config executable.

On Ubuntu, you can install it using

sudo apt -y install libgsl2-dev