0

Desire is to installed R {sf} and {RPostgres} packages on Ubuntu 18.04.4.

Trying:

R$> install.packages("sf")

configure: error: gdal-config not found or not executable.

Some SO searching (eg https://stackoverflow.com/a/49181048/2802810) suggests this:

sh$> sudo apt-get install libgdal-dev

The following packagess have unmet dependencies: libpq-dev : Depends: libpq5 (= 10.12-0Ubuntu0.18.04.1) but 12.3-1.pgdg18.04+1 is to be installed E: Unable to correct problems, you have broken packages.

I also need libpq-dev for R {RPostgres}.

Vinícius Félix
  • 8,448
  • 6
  • 16
  • 32
mark
  • 537
  • 6
  • 25
  • You probably want to upgrade to ubuntu 20.04 and take advantage of the `r-cran-*` on that LTS, as many changes, particularly regards PROJ6-7, and it'`s impact on rgdal, sf & etc. – Chris Jul 28 '20 at 12:26
  • Will def move to 20.+ LTR soon as poss. – mark Jul 28 '20 at 13:35

2 Answers2

0

You may want to add PPA, depending on your R version.

https://launchpad.net/~marutter/+archive/ubuntu/c2d4u

https://launchpad.net/~marutter/+archive/ubuntu/c2d4u3.5

https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+

After adding PPA, you can install using sudo apt install r-cran-sf and sudo apt install r-cran-rpostgres

MGD
  • 1
  • 6
0

OKaaaay. The box I'm working in didn't have a Postgres repo installed (https://www.postgresql.org/download/linux/ubuntu/). Never libpq libs and that was all it needed.

mark
  • 537
  • 6
  • 25