4

Anoyone try to install postgresql in Raspbian Stretch? I follow the instructions to the postgresql'site, but when in type sudo apt-get update, returns the follow error:

N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt strech-pgdg InReleas' doesn't support architecture 'armhf'

I read the other post here about installation in Raspian-Jessie. Is the same thing?

1
  • 2
    It's implicit here you've added a repo, probably one intended for x86(-64) users. There is no need to do that (and it could never work anyway). PostgreSQL is available in stock Raspbian -- looks like six different versions, in fact, up to 10.1. Undo whatever you did to the repo sources list and apt search postgresql, go from there.
    – goldilocks
    Commented Nov 24, 2017 at 0:04

4 Answers 4

4

As of right now (11/24/2017) you can install Postgresql v9.6 (stable/armhf) directly from the default Raspbian repositories via this command in the terminal/shell:

sudo apt install postgresql-9.6

If you need a newer version (10.1, etc.) then you may have to compile from the source. Painful, but doable...

Good luck!

2

I've built armhf binaries for Raspbian stretch for PostgreSQL 11.2 that you can use by adding the apt repo:

deb https://dl.cloudsmith.io/public/james-coleman/postgresql-arm-debian/deb/raspbian stretch main
1

To find out the latest version of PostgreSQL (that you can install with apt):

sudo apt-cache search postgresql | less

As of now (12/14/2017) latest version (from the default Raspbian Stretch apt repo; not Jessie or Wheezy) is still postgresql-9.6, but the good news is that there are a lot of extension packages for this version.

1

As others have suggested, you can install PostgreSQL by using:

$ sudo apt install postgresql-9.6

However I would not recommend using PgSQL on RPi unless:

  • your RPi is on battery / UPS or
  • you will put DB on an external hard drive.

It depends on frequency of writing to DB, but I've had 2 failures in last 2 months connected to power failures. One rendered SD card broken and the other corrupted data in PostgreSQL enough to make it unusable. In my case I had backups, but it still makes the solution very unreliable.

Note that the power failures were not frequent - one was caused by the storm while the other... just happened. There might have been others in between, but not many.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.