apt-get -f install dá erro

1

Quando eu executo o apt-get -f install, ele apresenta o seguinte erro:

# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libcdio10 lp-solve libunique-1.0-0 libgmime-2.4-2 libcdio-paranoia0 hplip-cups libmagickcore3 libtaglib2.0-cil libgkeyfile1.0-cil
  zeitgeist-extension-fts libgudev1.0-cil linux-headers-3.0.0-12 libtextcat-data libgdata1.9-cil libglew1.5 libproxy0 libgexiv2-0
  libmagickwand3 libgnomevfs2-common linux-headers-3.0.0-12-server libgupnp-1.0-3 libwebkitgtk-1.0-common python-indicate libnux-1.0-common
  libboost-date-time1.46.1 libindicator3-6 linux-headers-3.0.0-19-generic banshee python-webkit python-aptdaemon.gtkwidgets libindicator6
  gir1.2-gconf-2.0 libjavascriptcoregtk-1.0-0 libept1 banshee-extension-soundmenu libgnomevfs2-0 libmono-zeroconf1.0-cil libvpx0
  python-telepathy libgdata1.7-cil libminiupnpc5 libnotify0.4-cil libpoppler-glib6 python-aptdaemon-gtk libtextcat0 libgtk-sharp-beans-cil
  gnome-utils-common libxss1 libhunspell-1.2-0 unity-2d-places libjpeg62:i386 libquvi0 libexiv2-10 libgupnp-igd-1.0-3 gnome-desktop-data
  libgtkspell3-0 libnautilus-extension1 libwebkitgtk-1.0-0 gir1.2-dee-0.5 libcdio-cdda0 libmusicbrainz4c2a python-wnck libmagickcore3-extra
  libglewmx1.5 libnux-1.0-0 libgmime2.4-cil libnatpmp1 unity-2d-launcher libgssdp-1.0-2 libllvm2.9
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  postgresql-9.1
Suggested packages:
  oidentd ident-server locales-all
The following packages will be upgraded:
  postgresql-9.1
1 upgraded, 0 newly installed, 0 to remove and 80 not upgraded.
2 not fully installed or removed.
Need to get 0 B/4,290 kB of archives.
After this operation, 295 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 252269 files and directories currently installed.)
Preparing to replace postgresql-9.1 9.1.3-0ubuntu0.11.10 (using .../postgresql-9.1_9.1.4-0ubuntu12.04_amd64.deb) ...
 * Stopping PostgreSQL 9.1 database server
 * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 246.
Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 255.
(does not shutdown gracefully, now stopping immediately)
                                                         [fail]
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.1 database server
 * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 246.
Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 255.
(does not shutdown gracefully, now stopping immediately)
                                                          [fail]
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/postgresql-9.1_9.1.4-0ubuntu12.04_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 /var/cache/apt/archives/postgresql-9.1_9.1.4-0ubuntu12.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Eu tentei desinstalar o postgresql, mas não consegui. Por favor, conselhos.

    
por Shiv 20.06.2012 / 15:15

2 respostas

1

Eu acho que você seria novo no Ubuntu. sudo apt-get update <argument> apenas atualizará os repositórios e mostrará um erro porque você tem links errados (ruins). Depois de atualizar os repositórios, execute sudo apt-get upgrade para baixar e instalar as atualizações. Então, para atualizar totalmente seu pc do Ubuntu, você tem que digitar:

sudo apt-get update
sudo apt-get upgrade

Um melhor comando para o primeiro será:

sudo apt-get update -fmy
  • O argumento f é para corrigir dependências não resolvidas (quebradas).
  • O argumento m é para tentar pesquisar mesmo se os arquivos não puderem ser localizados.
  • O argumento y é para assumir sim para todas as consultas.
por Pranit Bauva 20.06.2012 / 15:23
1

Foi o que fiz para corrigir:

sudo rm /var/lib/postgresql/$$$YOUR VERSION$$$/main/postmaster.pid
sudo chown postgres:postgres /etc/postgresql/$$$YOUR VERSION$$$/main/environment
sudo chmod u+rw,g+rw /etc/postgresql/$$$YOUR VERSION$$$/main/environment
sudo pkill postgresql
sudo service stop postgresql 
sudo apt-get -f install

Certifique-se de substituir por sua versão do posgresql. O meu foi 9.3 (apenas coloque o cursor lá e clique em Tab ).

    
por David Valenza 12.02.2015 / 03:42