How to stop postgresql to free the port 5432

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I am trying to run this command to install wsgi for python Flask:



sudo apt-get install libapache2-mod-wsgi-py3


I am getting this error:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-wsgi-py3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] yes
Setting up postgresql-common (190.pgdg14.04+1) ...
* Starting PostgreSQL 9.5 database server * Error: Port conflict: another instance is already running on /var/run/postgresql with port 5432
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-9.5:
postgresql-9.5 depends on postgresql-common (>= 158~); however:
Package postgresql-common is not configured yet.

dpkg: error processing package postgresql-9.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.5:
postgresql-contrib-9.5 depends on postgresql-9.5 (= 9.5.12-1.pgdg14.04+1); however:
Package postgresql-9.5 is not configured yet.

dpkg: error processing package postgresql-contrib-9.5 (--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.
Errors were encountered while processing:
postgresql-common
postgresql-9.5
postgresql-contrib-9.5
E: Sub-process /usr/bin/dpkg returned an error code (1)


I tried many solutions to stop postgres such as:



sudo /etc/init.d/postgresql stop


2.



update-rc.d postresql off


3.



chconfig postresql off


4.



netstat -ntulp|grep 5432


5.



sudo service postgresql stop


All commands showing that I am being able to stop postgresql but when I run my command again to install wsgi, it gives me the same error again!!!







share|improve this question






















  • The problem is not that postgres owns a port, it's that the postgresql-9.5 package have been left in this state: dependency problems - leaving unconfigured and at this point apt will refuse to install anything until it's fixed. Removing the postgresql-9.5 package will probably solve it.
    – Daniel Vérité
    May 4 at 14:13















up vote
1
down vote

favorite












I am trying to run this command to install wsgi for python Flask:



sudo apt-get install libapache2-mod-wsgi-py3


I am getting this error:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-wsgi-py3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] yes
Setting up postgresql-common (190.pgdg14.04+1) ...
* Starting PostgreSQL 9.5 database server * Error: Port conflict: another instance is already running on /var/run/postgresql with port 5432
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-9.5:
postgresql-9.5 depends on postgresql-common (>= 158~); however:
Package postgresql-common is not configured yet.

dpkg: error processing package postgresql-9.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.5:
postgresql-contrib-9.5 depends on postgresql-9.5 (= 9.5.12-1.pgdg14.04+1); however:
Package postgresql-9.5 is not configured yet.

dpkg: error processing package postgresql-contrib-9.5 (--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.
Errors were encountered while processing:
postgresql-common
postgresql-9.5
postgresql-contrib-9.5
E: Sub-process /usr/bin/dpkg returned an error code (1)


I tried many solutions to stop postgres such as:



sudo /etc/init.d/postgresql stop


2.



update-rc.d postresql off


3.



chconfig postresql off


4.



netstat -ntulp|grep 5432


5.



sudo service postgresql stop


All commands showing that I am being able to stop postgresql but when I run my command again to install wsgi, it gives me the same error again!!!







share|improve this question






















  • The problem is not that postgres owns a port, it's that the postgresql-9.5 package have been left in this state: dependency problems - leaving unconfigured and at this point apt will refuse to install anything until it's fixed. Removing the postgresql-9.5 package will probably solve it.
    – Daniel Vérité
    May 4 at 14:13













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am trying to run this command to install wsgi for python Flask:



sudo apt-get install libapache2-mod-wsgi-py3


I am getting this error:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-wsgi-py3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] yes
Setting up postgresql-common (190.pgdg14.04+1) ...
* Starting PostgreSQL 9.5 database server * Error: Port conflict: another instance is already running on /var/run/postgresql with port 5432
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-9.5:
postgresql-9.5 depends on postgresql-common (>= 158~); however:
Package postgresql-common is not configured yet.

dpkg: error processing package postgresql-9.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.5:
postgresql-contrib-9.5 depends on postgresql-9.5 (= 9.5.12-1.pgdg14.04+1); however:
Package postgresql-9.5 is not configured yet.

dpkg: error processing package postgresql-contrib-9.5 (--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.
Errors were encountered while processing:
postgresql-common
postgresql-9.5
postgresql-contrib-9.5
E: Sub-process /usr/bin/dpkg returned an error code (1)


I tried many solutions to stop postgres such as:



sudo /etc/init.d/postgresql stop


2.



update-rc.d postresql off


3.



chconfig postresql off


4.



netstat -ntulp|grep 5432


5.



sudo service postgresql stop


All commands showing that I am being able to stop postgresql but when I run my command again to install wsgi, it gives me the same error again!!!







share|improve this question














I am trying to run this command to install wsgi for python Flask:



sudo apt-get install libapache2-mod-wsgi-py3


I am getting this error:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-wsgi-py3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] yes
Setting up postgresql-common (190.pgdg14.04+1) ...
* Starting PostgreSQL 9.5 database server * Error: Port conflict: another instance is already running on /var/run/postgresql with port 5432
[fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-9.5:
postgresql-9.5 depends on postgresql-common (>= 158~); however:
Package postgresql-common is not configured yet.

dpkg: error processing package postgresql-9.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.5:
postgresql-contrib-9.5 depends on postgresql-9.5 (= 9.5.12-1.pgdg14.04+1); however:
Package postgresql-9.5 is not configured yet.

dpkg: error processing package postgresql-contrib-9.5 (--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.
Errors were encountered while processing:
postgresql-common
postgresql-9.5
postgresql-contrib-9.5
E: Sub-process /usr/bin/dpkg returned an error code (1)


I tried many solutions to stop postgres such as:



sudo /etc/init.d/postgresql stop


2.



update-rc.d postresql off


3.



chconfig postresql off


4.



netstat -ntulp|grep 5432


5.



sudo service postgresql stop


All commands showing that I am being able to stop postgresql but when I run my command again to install wsgi, it gives me the same error again!!!









share|improve this question













share|improve this question




share|improve this question








edited Apr 19 at 17:43

























asked Apr 19 at 17:35









SineCo

114




114











  • The problem is not that postgres owns a port, it's that the postgresql-9.5 package have been left in this state: dependency problems - leaving unconfigured and at this point apt will refuse to install anything until it's fixed. Removing the postgresql-9.5 package will probably solve it.
    – Daniel Vérité
    May 4 at 14:13

















  • The problem is not that postgres owns a port, it's that the postgresql-9.5 package have been left in this state: dependency problems - leaving unconfigured and at this point apt will refuse to install anything until it's fixed. Removing the postgresql-9.5 package will probably solve it.
    – Daniel Vérité
    May 4 at 14:13
















The problem is not that postgres owns a port, it's that the postgresql-9.5 package have been left in this state: dependency problems - leaving unconfigured and at this point apt will refuse to install anything until it's fixed. Removing the postgresql-9.5 package will probably solve it.
– Daniel Vérité
May 4 at 14:13





The problem is not that postgres owns a port, it's that the postgresql-9.5 package have been left in this state: dependency problems - leaving unconfigured and at this point apt will refuse to install anything until it's fixed. Removing the postgresql-9.5 package will probably solve it.
– Daniel Vérité
May 4 at 14:13
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026472%2fhow-to-stop-postgresql-to-free-the-port-5432%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026472%2fhow-to-stop-postgresql-to-free-the-port-5432%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491