Неудовлетворенные зависимости при попытке установить любой пакет

Когда я пытаюсь что-то установить, например fish, я получаю это

    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).

, поэтому я пытаюсь запустить sudo apt-get install -f, но я получаю эту ошибку

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)
0
задан 4 January 2018 в 14:57

2 ответа

Проблема четко указана в сообщении об ошибке. Просто читайте по одной строке за раз, и все становится ясно:

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
  • Похоже, вы смешивали пакеты Debian и Ubuntu. НЕ ДЕЛАЙТЕ ЭТОГО. Придерживайтесь одного или другого .... или у вас возникнут такие проблемы.
  • Похоже, вы rm определяли файлы и каталоги, которые были размещены менеджером пакетов. НЕ ДЕЛАЙТЕ ЭТОГО. Всегда используйте менеджер пакетов для удаления файлов, размещенных менеджером пакетов.

Одно из решений состоит в том, чтобы просто устранить ущерб:

  • Используйте sudo mkdir для воссоздания каталогов, которые менеджер пакетов хочет удалить.
  • Удалите все пакеты из источников Debian, особенно openoffice-debian-menus
0
ответ дан 4 January 2018 в 14:57

У меня такая же проблема, и когда я сменил зеркальный сервер, проблема была устранена.

Шаг 1 . Перейдите к разделу «Программы и обновления».

Шаг 2 . Измените загрузку, выберите наиболее подходящее место для зеркала и выберите другое место.

Попробуйте снова установить программу... Надеюсь, это сработает

0
ответ дан 8 August 2020 в 04:52

Другие вопросы по тегам:

Похожие вопросы: