Desire将在Ubuntu 18.04.4上安装R{sf}和{RPostgres}软件包。
尝试:
R$> install.packages("sf")
configure:错误:找不到gdal配置或无法执行。
一些SO搜索(例如https://stackoverflow.com/a/49181048/2802810)提示:
sh$> sudo apt-get install libgdal-dev
以下包有未满足的依赖项:libpq-dev:取决于:libpq5(=10.12-0Ubuntu0.18.04.1(但12.3-1。pgdg18.04+1待安装E:无法更正问题,您已损坏包裹。
对于R{RPostgres},我还需要libpq-dev
。
您可能需要添加PPA,具体取决于您的R版本。
https://launchpad.net/~marutter/+archive/ubuntu/c2d4u
https://launchpad.net/~marutter/+archive/ubuntu/c2d4u3.5
https://launchpad.net/~c2d4u.team/+archive/ubuntu/c2d4u4.0+
添加PPA后,可以使用sudo apt install r-cran-sf
和sudo apt install r-cran-rpostgres
进行安装
好的。我工作的盒子没有安装Postgres repo(https://www.postgresql.org/download/linux/ubuntu/)。从来没有libpq-libs,这就是它所需要的。