0

I am using ubuntu 12.04. When i am trying to install package libpq-dev i am getting following error.

After this operation, 803 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
WARNING: The following packages cannot be authenticated!
  libpq5 libpq-dev
Install these packages without verification [y/N]? y
Err https://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main libpq5 i386 9.6.1-2.pgdg12.4+1
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Err https://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main libpq-dev i386 9.6.1-2.pgdg12.4+1
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Failed to fetch https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.6/libpq5_9.6.1-2.pgdg12.4+1_i386.deb  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Failed to fetch https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.6/libpq-dev_9.6.1-2.pgdg12.4+1_i386.deb  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
W: Duplicate sources.list entry http://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main i386 Packages (/var/lib/apt/lists/apt.postgresql.org_pub_repos_apt_dists_precise-pgdg_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I tried too many thing after googling but nothing worked out.I tried sudo apt-get update & sudo apt-get install libpq-dev --fix-missing but no luck.

Salil
  • 101

1 Answers1

1

A correct and up-to-date PGP public key must be installed to use the apt.postgresql.org repository. Based on the error messages, it looks like that is what is failing in your case.

https://wiki.postgresql.org/wiki/Apt has instructions on how to install it, essentially:

sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
Daniel Vérité
  • 1,213
  • 8
  • 10