Erro ao tentar consertar “dependências não atendidas” no Ubuntu Server 14.04

0

Estou tentando instalar o php5-dev:

sudo apt-get install php5-dev

Mas recebi este erro:

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 postgresql-contrib-9.3 : Depends: postgresql-9.3 (= 9.3.9-0ubuntu0.14.04) but 9.3.5-0ubuntu0.14.04.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Então, eu corro o comando:

sudo apt-get -f install

Mas então recebo este erro:

invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
 * Stopping PostgreSQL 9.3 database server
 * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 255.
Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 264.
(does not shutdown gracefully, now stopping immediately)

[fail]
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/postgresql-9.3_9.3.9-0ubuntu0.14.04_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/postgresql-9.3_9.3.9-0ubuntu0.14.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Minha configuração:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

Eu não tenho ideia de como consertar isso ... Alguém pode me ajudar?

    
por skirato 03.07.2015 / 12:33

2 respostas

0

Não consegue parar, por isso, tente pará-lo manualmente:

sudo service postgresql stop

Verifique se o apt apt está atualizado:

sudo apt-get update

Tente novamente corrigir:

sudo apt-get -f install

Se isso não funcionar, limpe o postgresql completamente. Veja, que pacotes postgresql estão instalados:

dpkg -l | grep postgresql

Em seguida, remova com sudo apt-get remove <package name> . Preste atenção nas mensagens como "OS SEGUINTES PACOTES SERÃO REMOVIDOS", não aceite se coisas importantes estiverem listadas aqui.

Tente mais uma vez corrigir:

sudo apt-get -f install

...

    
por Velkan 04.07.2015 / 11:00
0

A versão atual de postgresql-9.3 em trusty main é 9.3.7-0ubuntu0.14.04 . Para instalar o 9.3.9-0ubuntu0.14.04 , você precisa de trusty-updates main .

Abra o arquivo /etc/apt/sources.list

sudo nano /etc/apt/sources.list

e verifique se você ativou o repositório trusty-updates pelo menos para main

por exemplo:

deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe

Os resultados da pesquisa de pacotes do Ubuntu

Paket postgresql-9.3

    trusty (14.04LTS) (database): object-relational SQL database, version 9.3 server
    9.3.7-0ubuntu0.14.04 [security]: amd64 i386
    trusty-updates (database): object-relational SQL database, version 9.3 server
    9.3.9-0ubuntu0.14.04: amd64 i386
    
por A.B. 04.07.2015 / 11:46