Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I run apt-get upgrade, I get the following error :

dpkg: dependency problems prevent configuration of postgresql-9.1:
 postgresql-client-9.1 (9.1.7-0ubuntu12.04) breaks postgresql-9.1 (<< 9.1.7-0ubuntu12.04) and is installed.
  Version of postgresql-9.1 to be configured is 9.1.6-1~precise2.
dpkg: error processing postgresql-9.1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-9.1; however:
  Package postgresql-9.1 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                               No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                                         No apport report written because MaxReports is reached already
                  dpkg: dependency problems prevent configuration of postgresql-contrib-9.1:
 postgresql-contrib-9.1 depends on postgresql-9.1 (= 9.1.7-0ubuntu12.04); however:
  Version of postgresql-9.1 on system is 9.1.6-1~precise2.
dpkg: error processing postgresql-contrib-9.1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib:
 postgresql-contrib depends on postgresql-contrib-9.1; however:
  Package postgresql-contrib-9.1 is not configured yet.
dpkg: error processing postgresql-contrib (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 postgresql-9.1
 postgresql
 postgresql-contrib-9.1
 postgresql-contrib
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried apt-get -f upgrade but the same error occurs.

What can I do to fix this issue? It totally messes up APT.

Note: I'm using the following PPA for PostgreSQL : https://launchpad.net/~pitti/+archive/postgresql

Update: Sorry for the formatting, here is a gist https://gist.github.com/e0752bb50e63ef4b3a4c

share|improve this question
add comment

2 Answers

Had same problem on a test machine some time ago.
I just disabled the pitti, uninstalled, cleaned, reinstalled, enabled pitti, updated. Maybe I am missing some steps but for me it helped.
Relevant lines from history:

sudo vim /etc/apt/sources.list.d/ubuntugis-ppa-precise.list
sudo vim /etc/apt/sources.list.d/pitti-postgresql-precise.list
sudo apt-get remove postgresql-9.1
sudo apt-get remove postgresql-client-9.1
sudo apt-get clean
sudo apt-get update
sudo apt-get install postgresql-9.1
sudo apt-get install postgresql-9.1-postgis 
sudo apt-get install postgresql-contrib-9.1 
sudo vim /etc/apt/sources.list.d/pitti-postgresql-precise.list
sudo vim /etc/apt/sources.list.d/ubuntugis-ppa-precise.list 
sudo apt-get update
sudo apt-get upgrade
share|improve this answer
    
BTW you could probably sudo su - once and then run all the commands without having to prefix them all with sudo! –  slm Jan 20 '13 at 1:24
    
I am aware of that possibility and use it where appropriate, but I usually use sudo because of nice lines in /var/log/auth.log (logs user and command). Additionally I like to work on user privileges, and gain elevated privileges specifically for one line. –  Elary Jan 20 '13 at 3:49
1  
Does the uninstall clean the existing databases or are they kept? –  OyoKooN Jan 29 '13 at 19:36
    
When I run apt-get remove postgresql-9.1, the same error message appears... –  OyoKooN Feb 4 '13 at 18:56
    
@OyoKooN: I wonder the same. 99% sure I would say NO. 'apt-get purge' would delete it. 'apt-get remove' not. But 99% is not enough for a production DB ;-) –  alfonx Feb 13 '13 at 8:55
add comment

I had the same problem. apt-get -f install doesn't worked. With aptitude it worked.

aptitude -f install removed postgres but not the databases. Afterwards apt-get install postgres reinstalled postgres. Happy again :-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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