https://www.orchest.io/ logo
s

Sean Birchall

10/02/2022, 1:27 AM
Has anyone had any luck installing the package
RPostgreSQL
in their R environment? Keep getting the same error message in the screenshot, even if I install Postgres first.
Copy code
sudo apt-get install libpq-dev
sudo sh -c 'echo "deb <http://apt.postgresql.org/pub/repos/apt> $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - <https://www.postgresql.org/media/keys/ACCC4CF8.asc> | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
Rscript -e 'install.packages("RPostgreSQL", dependencies=TRUE, repos="<http://cran.rstudio.com/>")'
👀 1
j

juanlu

10/03/2022, 8:29 AM
hello @Sean Birchall! I confirm I can reproduce the issue. looking into this.
oops, missed this 🙂
Copy code
Reading state information...
The following additional packages will be installed:
  libpq5
Suggested packages:
  postgresql-doc-12
The following NEW packages will be installed:
  libpq-dev libpq5
0 upgraded, 2 newly installed, 0 to remove and 155 not upgraded.
Need to get 254 kB of archives.
After this operation, 1,000 kB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
the
apt-get install libpq-dev
call is missing a
--yes
flag, otherwise the installation never proceeds. this build script successfully installs RPostgreSQL:
Copy code
#!/bin/bash

sudo apt-get install -y libpq-dev

Rscript -e 'install.packages("RPostgreSQL", dependencies=TRUE, repos="<http://cran.rstudio.com/>")'
let me know if that works for you
s

Sean Birchall

10/03/2022, 2:30 PM
That was easy, yes it does work for me. Thank you!
🙌🏼 1