Dependências não atendidas ao tentar instalar qualquer pacote

0

Quando tento instalar algo, por exemplo peixe, recebo este

    fun2code@fun2code-ThinkPad-X220:~$ sudo apt-get install fish
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies:
     fish : Depends: fish-common (= 2.2.0-3) but it is not going to be installed
            Recommends: xsel but it is not going to be installed
     libreoffice-core : Depends: libreoffice-common (> 1:5.1.6~rc2) but it is not going to be installed
     libreoffice-java-common : Depends: libreoffice-common (= 1:5.1.6~rc2-0ubuntu1~xenial2) but it is not going to be installed
     libreoffice-style-elementary : Depends: libreoffice-

common (= 1:5.1.6~rc2-0ubuntu1~xenial2) but it is not going to be installed
 libreoffice-style-galaxy : Depends: libreoffice-common (= 1:5.1.6~rc2-0ubuntu1~xenial2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Então, tento executar sudo apt-get install -f , mas recebo esse erro

fun2code@fun2code-ThinkPad-X220:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies...Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
 Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages were automatically installed and are no longer required:
  fonts-roboto fonts-roboto-hinted libavfilter-ffmpeg5 libavresample-ffmpeg2
  libbs2b0 libcec-platform1v5 libcec3 libflite1 libfstrcmp0 libjs-iscroll
  libllvm4.0 libllvm4.0:i386 libopencv-core2.4v5 libopencv-imgproc2.4v5
  libqt4-designer libqt4-help libqt4-opengl libqt4-scripttools libqt4-test
  libqtassistantclient4 libqtwebkit4 libsdl2-2.0-0 libsndio6.1 libsodium18
  libtbb2 libzmq5 python3-pyqt4 python3-sip
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libreoffice-common
Suggested packages:
  libreoffice-style-breeze libreoffice-style-hicontrast
  libreoffice-style-human libreoffice-style-oxygen libreoffice-style-sifr
  libreoffice-style-tango
The following NEW packages will be installed:
  libreoffice-common
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
21 not fully installed or removed.
Need to get 0 B/22,2 MB of archives.
After this operation, 84,9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 181275 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb ...
Unpacking libreoffice-common (1:5.1.6~rc2-0ubuntu1~xenial2) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb (--unpack):
 trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.1.4-9788
rmdir: failed to remove '/var/lib/libreoffice/share/prereg/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/share/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/program/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for gnome-icon-theme (3.12.0-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
    
por fun2code 04.01.2018 / 12:57

1 resposta

0

O problema é claramente indicado na mensagem de erro. Basta ler uma linha de cada vez e está bem claro:

Unpacking libreoffice-common (1:5.1.6~rc2-0ubuntu1~xenial2) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb (--unpack):
 trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.1.4-9788
rmdir: failed to remove '/var/lib/libreoffice/share/prereg/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/share/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/program/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
  • Parece que você está misturando os pacotes Debian e Ubuntu. Não faça isso. Ficar com um ou outro .... ou você tem problemas como este.
  • Parece que você usou rm -os arquivos e diretórios que foram colocados pelo gerenciador de pacotes. Não faça isso. Sempre use o gerenciador de pacotes para remover arquivos colocados pelo gerenciador de pacotes.

Uma solução é simplesmente desfazer o dano:

  • Use sudo mkdir para recriar os diretórios que o gerenciador de pacotes deseja remover.
  • Desinstale todos os pacotes de fontes Debian, especialmente openoffice-debian-menus
por user535733 04.01.2018 / 16:55