How to fix R package installation /usr/bin/ld: cannot find -llapack

Problem:

While installing some R package, you see an error message like

missing_lapack_error.sh
/usr/bin/ld: cannot find -llapack

Solution

You need to install the liblapack development headers. On Ubuntu, you can do that using

install_liblapack_dev.sh
sudo apt -y install liblapack-dev

Check out similar posts by category: R