Trying to do
install.packages("rgdal") on my GNU/Linux machine failed at first. It seems that my system had a couple of libraries not installed, so in the terminal:
sudo apt install libgdal-dev
sudo apt install libproj-dev
install.packages("rgdal") back in R.
Modified from: https://stackoverflow.com/questions/44382368/rgdal-installation-difficulty-on-ubuntu-16-04-lts
It’s common that GNU/Linux users have to compile R packages when installing them. For packages with dependencies, cran2deb offers a readily-packaged solution for some of the most common packages on Debian. rgdal doesn’t seem to be one of them, and install.packages(“rgdal”) led to a non-zero exit status. The solution: install the dependencies, of course.
sudo apt-get install libproj-dev libgdal-dev
On my machine this pulled a long list of further dependencies, but subsequently rgdal installed without complaints.