Зафиксированы сломанные пакеты linux

При попытке установить ругается на сломанные пакеты. Как вылечить linux?

root@dev:/home/xfile/Загрузки# apt-get install kate
Чтение списков пакетов… Готово
Построение дерева зависимостей… Готово
Чтение информации о состоянии… Готово
Некоторые пакеты не могут быть установлены. Возможно, то, что вы просите,
неосуществимо, или же вы используете нестабильную версию дистрибутива, где
запрошенные вами пакеты ещё не созданы или были удалены из Incoming.
Следующая информация, возможно, вам поможет:

Следующие пакеты имеют неудовлетворённые зависимости:
kate : Зависит: plasma-framework но он не может быть установлен
Зависит: libkf5newstuff5 (>= 5.27.0) но он не может быть установлен
Зависит: libkf5plasma5 (>= 4.96.0) но он не может быть установлен
libkf5xmlgui5 : Ломает: ktexteditor-katepart ( < 5.70) но 5.54.0-1 должен быть установлен
Ломает: libkf5texteditor5 ( < 5.70) но 5.54.0-1 должен быть установлен
E: Невозможно исправить ошибки: у вас зафиксированы сломанные пакеты.
root@dev:/home/xfile/Загрузки#

root@dev:/home/xfile# sudo apt install snapd
Чтение списков пакетов… Готово
Построение дерева зависимостей… Готово
Чтение информации о состоянии… Готово
Некоторые пакеты не могут быть установлены. Возможно, то, что вы просите,
неосуществимо, или же вы используете нестабильную версию дистрибутива, где
запрошенные вами пакеты ещё не созданы или были удалены из Incoming.
Следующая информация, возможно, вам поможет:

Следующие пакеты имеют неудовлетворённые зависимости:
apparmor : Ломает: snapd ( < 2.44.3+20.04~) но 2.37.4-1+b1 должен быть установлен
E: Невозможно исправить ошибки: у вас зафиксированы сломанные пакеты.
root@dev:/home/xfile#

Чего только не пробовал. Не получается никак восстановить работоспособность системы.

Простой 3 комментария

Источник

Fixing «Unable to correct problems, you have held broken packages» Error in Ubuntu and other Linux Distributions

Facing «Unable to correct problems, you have held broken packages» error in Ubuntu/Debian? Here’s what you can do to fix this issue.

While there are various ways to install applications in Ubuntu, I prefer to use the apt command in the terminal for installing software. If you do the same, you may come across a dependency error like this:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: green-recorder : Depends: python-urllib3 but it is not installable E: Unable to correct problems, you have held broken packages.

Usually on It’s FOSS, you’ll find simple and easy to follow solutions to complicated problems. Unfortunately, this one is not that straightforward. In this troubleshooting article, I’ll tell you why this error occurs and give some pointers on how to go about solving this issue.

Читайте также:  Mysql linux установка manjaro

Why do you see the “you have held broken packages” error?

Broken Package Error Ubuntu

You were trying to install an application package, most probably from a PPA or third-party repository. Applications often need specific versions of libraries and software component (called dependencies). These dependencies may not be part of the application package itself, but they are expected to either be installed on your system already or installed during the installation of the application. Your Linux system tries to install these dependencies on its own. But if the dependency package version is not available on your system, it gets confused as it has no way to solve this dependency problem. This is why it informs you that the software you were trying to install depends on XYZ but this XYZ cannot be installed. Another usecase is when your package can be held is when you try to install two versions of the same software. Say you are installing a specific version of Wine when you have another one installed already.

How to go about fixing the “Unable to correct problems, you have held broken packages” error

You can try a few things to make things work. You need to have some ideas on installing/removing packages in Linux command line to work things out here.

Make sure that your system’s package cache is updated

First, make sure that local package cache is updated. Your system checks this cache for the available packages. It’s possible (but not certain) that the dependency package is seen by the system after the cache update.

Install the dependency

If you try to install the troublesome package again and it still complains about the same dependency error than perhaps that dependency is not available for distribution version. You may use the apt search command see if you could this library from some other package or name:

sudo apt search package_name

If the package is available, is it the same version as requested by the package you were trying to install? Try to install the dependency package and see what happens:

sudo apt install dependency_package

You may encounter a dependency chain. You try to install dependency A but it complains of B. Then you try installing B and it complains of C. It may also happen that when you try to install package C, it is already installed. Check the version of package C. Is it the same version as required by package B? If yes, then removing C and installing it again could help.

Can you get the missing dependency package from some other source?

If the missing dependency package cannot be found on your system (no results in apt search), you may try to get the dependency package from some place else. I know that’s not very convenient thing to do but you don’t have many options here. For example, in the case of installing shutter, it complained about libgoo-canvas-perl and this library is no more available on Ubuntu system.

sudo apt install shutter Reading package lists. Done Building dependency tree Reading state information. Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: shutter : Depends: libgoo-canvas-perl but it is not going to be installed E: Unable to correct problems, you have held broken packages.

However, since it was available in the previous versions of Ubuntu, I looked for this package on Ubuntu’s package archive and found it under the listing of Ubuntu 14.04 here. I downloaded the .DEB file and installed it. Now that this dependency package is installed, trying to install the original application (shutter in this case) should not complain about at least this package anymore.

Читайте также:  Linux openssl get version

If you cannot find the dependency package anywhere, install the troublesome package from some other source

So in the example above, I tried to install Green Recorder application using its PPA. This application needs python-urllib3 library but unfortunately, this library is not available in my Ubuntu 20.04 system.

[email protected]:~$ apt search python-urllib3 Sorting. Done Full Text Search. Done

Clearly, this is a poorly packaged application. The developer made it available for Ubuntu 20.04 without realizing that Ubuntu 20.04 doesn’t support Python 2 anymore and all the Python libs now start with python3 prefix. So the python-urllib3 should be python3-urllib3. If you are in such a situation, maybe check the project’s homepage or search on the internet for an alternate source for installing it. Perhaps there is a Snap/Flatpak version or some user created a PPA for it? If nothing else, you may go with source code option as well.

If you see the held broken package error during update try this

Most of the discussion so far assumed that you see this error while installing a new application. That may not always be the case. If you see this error when you try updating your system with sudo apt update command, then you’ll have to take a slightly different approach. First, check which package is being held with this command:

dpkg --get-selections | grep hold

If you see some packages being held, remove them and then go on updating your system or installing the software. You may also use Synaptic package manager for fixing the broken packages.

Did you manage to fix the issue?

As I had mentioned earlier, there is no straightforward fix for this problem. You’ll have to investigate on your own and see if it can be fixed or not. Please share in the comments if your problem gets fixed. If not, I may try to help you out.

Источник

Исправляем сломанные пакеты в Debian – Ubuntu

Если вы активный пользователь Linux, то наверняка встречались с тем, что некоторые пакеты так сказать ломаются. Это может быть вызвано по разным причинам, некорректно установленный пакет, какие-то ошибки во время установки и многое другое. Что в свою очередь может сказаться и на самом менеджере пакетов “apt-get”, и как итог, возможно что дойдет даже то того, что вы не сможете обновляться или устанавливать программное обеспечения. Данная статья поможет вам решить вопрос со сломанными пакетами в Debian / Ubuntu, а так же их производными. Так как сломанные пакеты могут возникать по разным причинам, существует несколько способов для решения этой задачи, но, не все они могут сработать, тут все зависит от конкретного случая.

Читайте также:  Linux print exit code

P.S. Желательно точно знать какой пакет у вас сломан, так как это поможет вам выбрать один из способом решения задачи.

Чиним сломанные пакеты с apt-get

Первый вариант, который может помочь починить сломанные пакеты имеется в самом менеджере пакетов apt, и для починки сломанных пакетов достаточно ввести две команды:

sudo apt-get update --fix-missing sudo apt-get install -f

сломанные пакеты в Debian Ubuntu 1

Этот способ поможет для решения уже установленных в вашей системе пакетов, который по каким то причинам сломались. После выполнения первой команды необходимо убедиться, что она исправила ошибки, а затем переходить к введению второй команды. Возможно, что для исправления сломанных пакетов понадобиться несколько минут:

Чиним сломанные пакеты с apt-get и dpkg

Но, что делать если пакет сломался во время установки? Можно попробовать выполнить команды из первого примера, если они не сработают, переходим к использованию apt-get и dpkg, для этого первым делом используем dpkg для настройки пакетов. А затем выполняем очистку apt-get:

sudo dpkg --configure -a sudo apt-get clean sudo apt-get update

сломанные пакеты в Debian Ubuntu 2

В некоторых ситуациях может понадобиться удалить файл блокировки, после удаления файла блокировки, снова выполните предыдущие команды:

sudo rm /var/lib/apt/lists/lock

Принудительное удаление пакета с помощью apt-get и dpkg

В редких ситуациях может случиться и такое, что ни один из выше указанных методов не сработает и вам понадобиться вручную удалить сломанный пакет. Для этого разумеется вы должны точно знать что это за пакет, и первый вариант удаление пакета с помощью apt-get, для этого вводим команду:

sudo apt-get remove и название пакета

Если же вам не удалось удалить пакет, переходим к кардинальным мерам, для принудительного пакеты введите команду:

sudo dpkg --remove --force-remove-reinstreq и название пакеты

Затем выполните очистку и обновление пакетов:

sudo apt-get clean && sudo apt-get update

Заключение

Если вы не знаете про менеджеры пакетов apt-get и dpkg, на WIKI имеется статьи, первая про apt, вторая статья про dpkg. В редких ситуациях, выше приведенных мер может быть недостаточно для исправления сломанных пакетов. В этом случае, может понадобиться ручная сборка и удаление сломанных пакетов, правда, имеется риск повредить работоспособность всей системы, что в свою очередь может вывести ее из строя. В этом случае, если вы делали резервные копии вашей системы можно откатиться работоспособной версии системы. Сделать резервную копию вашей системы можно при помощи Timeshift или Deja Dup, последняя имеется в дистрибутиве Ubuntu. Но, чаще всего удается отделаться малой кровью когда появляются сломанные пакеты, и выше приведенных мер достаточно для исправления сломанных пактов.

А на этом сегодня все. Надеюсь данная статья будет вам полезна.
Журнал Cyber-X

Источник

Оцените статью
Adblock
detector