Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

While trying to set up my rails environment to use postgresql I mistakenly installed postgres-xc.

However an error occurred in installation, so when I tried to remove the package I get the following error:

The following packages will be REMOVED:  

  postgres-xc   
   0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.  
1 not fully installed or removed.  
After this operation, 17.2 MB disk space will be freed.  
Do you want to continue [Y/n]? y  
(Reading database ... 269015 files and directories currently installed.)  
Removing postgres-xc ...  
dpkg (subprocess): unable to execute installed pre-removal script  (/var/lib/dpkg/info/postgres-xc.prerm): No such file or directory  
dpkg: error processing postgres-xc (--remove):  
 subprocess installed pre-removal script returned error exit status 2  
 * Starting Postgres-XC datanode                                                                                                                                                   pg_ctl: another server might be running; trying to start server anyway  
pg_ctl: another server might be running; trying to start server anyway  
                                                                                                                                                                            [ OK ]
 * Starting Postgres-XC coordinator                                                                                                                                                  pg_ctl: another server might be running; trying to start server anyway  
                                                                                                                                                                          [ OK ]  
 * Starting Postgres-XC gtm                                                                                                                                                      gtm_ctl: another server might be running; trying to start server anyway  
gtm_ctl: could not start server  
Examine the log output.  
invoke-rc.d: initscript postgres-xc, action "start" failed.  
dpkg: error while cleaning up:  
 subprocess installed post-installation script returned error exit status 1  
Errors were encountered while processing:  
 postgres-xc  
E: Sub-process /usr/bin/dpkg returned an error code (1)  

Googling shows some solutions point to editing the /var/lib/dpkg/info/postgres-xc.prerm file to include exit 0 but that doesn't work. Also, notice that its not even recognizing that file.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Open the file using the command

sudo nano /var/lib/dpkg/status

then remove the broken package postgres-xcand the whole block of information about it and save the file.

then do

apt-get install -f

apt-get update

share|improve this answer
    
Success! I didn't know you could remove packages that way. Thanks a ton. –  user191583 Nov 16 '13 at 3:14
    
Ya. Yes you can. :) –  Tarun Nov 16 '13 at 7:05

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.