E unable to correct problems you have held broken packages kali linux

Fix: Unable to Correct Problems ‘You have Held Broken Packages’

You might find that when you’re trying to install a package on Linux you find a dreaded line that reads E: Unable to correct problems, you have held broken packages. The installation then refuses to progress beyond this point. You might find this on any Linux distribution that uses apt-get to manage packages, which includes Debian as well as the various Linux Mint and Ubuntu spin-offs.

It’s caused by broken dependencies, which are a side-effect from having packages installed that depend on other packages that aren’t installed. When apt-get goes to install something, it notices that it doesn’t have access to something that it needs and therefore can’t continue. A few basic command line tricks as well as a graphical tool can fix everything up quickly.

Method 1: Using dpkg –configure to Fix Held Broken Packages

While working at the terminal, trying running sudo dpkg –configure -a to start an automatic update process that looks for any broken dependencies on your system caused by packages that aren’t installed. This tool should automatically install any package that it feels you’re missing without user intervention, though if you’re asked to install something then you should push the y key in order to respond to the prompt.

If it doesn’t find any broken packages, then you shouldn’t see any output. We ran this on a clean test machine running Xubuntu, so it didn’t find any errors, but if you’ve been getting “Unable to Correct Problems, You have Held Broken Packages” problems then this might find several packages you need to install. Once you’ve run it, try sudo apt-get install -f from the command line.

This program will go through and build a dependency list then read state information. If you get a message stating that there were “0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded” packages, then you were either working with no broken dependencies or the previous command fixed everything. At this point, you can run sudo apt-get clean && sudo apt-get update followed by sudo apt-get upgrade to update every package on your system. This might take a while depending on how long your system had these package issues.

Method 2: Using the dist-upgrade Command

If you get a message saying that “some packages have been held back” so you couldn’t successfully complete the earlier command, then you should run sudo apt-get dist-upgrade to install the rest of these packages. As well as performing the function of a regular upgrade, the dist-upgrade option handles changed dependencies with newer versions of packages. Since apt-get has a special conflict system, it usually attempts to upgrade the most important packages at the cost of not doing anything to those less vital to your system. Using this command forces even those to update.

Читайте также:  Linux view usb devices

That being said, if there aren’t any broken packages detected you’ll just end up with a third message about there being nothing upgraded and nothing newly installed. If this is the case, then you could try sudo apt-get upgrade again so that if there were any changes the automatic upgrade subroutine can take hold. On the other hand, if you know the specific name of the package that you need, then you could install it manually.

For instance, assume that the GNUStep runtime component was what you were lacking since you wanted to use voice synthesis. You could simply type sudo apt-get install gnustep-gui-runtime to install this vital package. Keep in mind that this is merely an example and you could replace gnustep-gui-runtime with the name of any package you need to install. Modern distributions based around the apt-get standard have several thousand packages, but as long as you know the name of the one you’re looking for this will force it to install.

Method 3: Fix Broken Packages with Synaptic

If you have the Synaptic graphical package manager, then you can also use this tool to fix any broken packages you might have. Open the program and then select the Edit drop-down picklist menu. You should have a “Fix Broken Packages” option in this menu, so select it if you do. It won’t take very long to run if there aren’t many broken packages, but it might find a number of errors which would slow execution.

Once it finishes running through everything, you’ll notice the words “Successfully fixed dependency problems” in the bottom status line.

You can now update and install packages just like normal. Most users will only do things in this manner if they were already working in Synaptic, but it’s there whenever you need it. Once it’s run you can close Synaptic and work from the command prompt again or continue to make changes here.

Источник

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.

Читайте также:  Телеграмм для кали линукс

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 настройка tor privoxy

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.

Источник

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