The following guide is derived from a Posit guide to installing R from source and is tailored to Debian/Ubuntu distributions of Linux:
We recommend using the pak package to manage R packages. It provides more explicit reporting of dependences:
install.packages('pak')
pak::pkg_install('tidyverse')