How to install rgdal on Ubuntu 12.10?
A more recent answer can be found here: http://robinlovelace.net/r/2013/11/26/installing-rgdal-on-ubuntu.html .
Essentially, the three following lines of code should sort it:
sudo apt-get install aptitude # install aptitude as an alternative to apt-get
sudo aptitude install libgdal-dev # install the package (you may have to respond to queries here)
sudo aptitude install libproj-dev # install the proj.4 projection library
Spent ages on this problem, so hope this updated answer is useful to others. Let me know if so!
Try running them all together and specifying the versions, like this:
sudo apt-get install libgdal1-dev libgdal-dev libgeos-c1=3.3.3-1.1 libspatialite3=3.1.0~rc2-1ubuntu1
apt-get does not like to downgrade packages, but it will if you specify it.
Here in January 2016, on Ubuntu 14.04.2 (and with R 3.2.2), I needed the following to get both rgdal and the complementary (and frequently very useful) gdalUtils package installed:
sudo apt-get update
sudo apt-get -y install libgdal1h
sudo apt-get -y install libgdal1-dev
sudo apt-get install libproj-dev
sudo apt-get install gdal-bin
Rscript 'install.packages(c("rgdal", "gdalUtils"))'
Update: As on January 2017, the version of libgdal is 1i, so the second line of code should read:
sudo apt-get -y install libgdal1i