E: Unable to correct problems, you have held broken packages.

omertoptas

New Member
Joined
Aug 22, 2023
Messages
5
Reaction score
0
Credits
40
I'm trying to download Spotify but this gives error. (i did update and upgrade)(sudo apt-get update - upgrade)


Which version should I choose? Debian 64 bit Or linux 2.6/3.x/4.x/5.x/(64bit)
 
Last edited:


You have a broken installation because you have installed packages from sources other than your distribution's repository, or you interrupted an update after upgrading some packages but not all the dependencies.

Please use the search box and paste the message error, as this has been discussed plenty for other Debian derivatives.
 
Welcome to the Forum.
m0135.gif


You don's say what Distro you're using...if it's Mint Cinnamon you can fix this very easily...

Synaptic Package Manager's menu > Edit > Fix Broken Packages...fixed.
m0114.gif
 
It's in Kali LInux, mate
 
EDIT: more time to elaborate now.

I know.

Kali Linux is a Debian derivative that uses the same package distribution format (.deb) with the same weaknesses, hence my answer. Debian, Ubuntu, Mint (regardless whether it is Ubuntu or Debian flavour) Raspbian, Kali... all of them will pop up that error under certain conditions and the way back to stability will be within the same alternatives:
  1. restore a snapshot,
  2. manually undo the last operation (unlikely to succeed),
  3. further trust apt to reinstall broken packages (may trigger major system-side uninstalls), force reinstall dependencies of broken packages during upgrades (see here as many of those operations are offered, but it may not be possible if the package is broken or the PPA utterly uncompatible),...
Those weaknesses and solutions apply equally to all Debian derivatives (as in "using .deb and apt, and dpkg") and why, for example, PPA in Ubuntu are usually discouraged, or why Don't break Debian exists.

My best advice is: if you don't have a package in the repos of your distribution, install a sandboxed version (flatpak, appimage, snap). Never download and install .deb from elsewhere --it breaks the system more often than not.
 
Last edited:
It is always best to install applications from your distribution repository [software manager] remove any previous installations first.

The alternative for Debian distributions is

configure the debian repository: from the terminal run.

curl -sS https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg

echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list


Then to install Spotify for Debian

sudo apt-get update && sudo apt-get install spotify-client
 
It is always best to install applications from your distribution repository [software manager] remove any previous installations first.

The alternative for Debian distributions is

configure the debian repository: from the terminal run.

curl -sS https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg

echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list


Then to install Spotify for Debian

sudo apt-get update && sudo apt-get install spotify-client

This can break the system even deeper.

In .deb distributions, you should always stick to your distribution repositories as they are the packages that have been tested together. If, installing from debian repositories a package on Kali, pulls a dependency that is incompatible with the rest of the Kali system, you'll get the error OP got, and hence back to the starting point, and probably you'll be buried under much more severe issues.
 
Everything said in Don't Break Debian applies to each and every distribution that uses .deb packages, e.g., in the following text, you can replace "Debian" by "Kali" or "Ubuntu" or "Mint", because what it's talking about is apt and .deb packages in the end:
Don't Break Debian said:

Don't make a FrankenDebian​

Debian Stable should not be combined with other releases carelessly. If you're trying to install software that isn't available in the current Debian Stable release, it's not a good idea to add repositories for other Debian releases.

First of all, apt-get upgrade default behavior is to upgrade any installed package to the highest available version. If, for example, you configure the trixie archive on a bookworm system, APT will try to upgrade almost all packages to trixie.

This can be mitigated by configuring apt pinning to give priority to packages from bookworm.

However, even installing few packages from a "future" release can be risky. The problems might not happen right away, but the next time you install updates.

The reason things can break is because the software packaged for one Debian release is built to be compatible with the rest of the software for that release. For example, installing packages from trixie on a bookworm system could also install newer versions of core libraries including libc6. This results in a system that is not testing or stable but a broken mix of the two.

Repositories that can create a FrankenDebian if used with Debian Stable:

  • Debian testing release (currently trixie)
  • Debian unstable release (also known as sid)
  • Ubuntu, Mint or other derivative repositories are not compatible with Debian!
  • Ubuntu PPAs and other repositories created to distribute single applications
Some third-party repositories might appear safe to use as they contain only packages that have no equivalent in Debian. However, there are no guarantees that any repository will not add more packages in future, leading to breakage.

Finally, packages in official Debian releases have gone through extensive testing, often for months, and only fit packages are allowed in a release. On the other hand, packages from external sources might alter files belonging to other packages, configure the system in unexpected ways, introduce vulnerabilities, cause licensing issues.

Once packages from unofficial sources are introduced in a system it can become difficult to pinpoint the cause of breakage especially if it happens after months.

That means: inter-distribution installs, or "hey there's a .deb pakcage on XYZ website" will likely be producing OP's error.
 
This can break the system even deeper.
And that's why I start with....It is always best to install applications from your distribution repository [software manager]
And I would have expected [although many don't] Kali users to have read and understood the documentation that comes with it

Extracts..

A minimal and trusted set of repositories: given the aims and goals of Kali Linux, maintaining the integrity of the system as a whole is absolutely key. With that goal in mind, the set of upstream software sources which Kali uses is kept to an absolute minimum. Many new Kali users are tempted to add additional repositories to their sources.list, but doing so runs a very serious risk of breaking your Kali Linux installation.

As the distribution’s developers, you might expect us to recommend that everyone should be using Kali Linux. The fact of the matter is, however, that Kali is a Linux distribution specifically geared towards professional penetration testers and security specialists, and given its unique nature, it is NOT a recommended distribution if you’re unfamiliar with Linux or are looking for a general-purpose Linux desktop distribution for development, web design, gaming, etc.
 
Last edited:
You're posting an example of how to break Debian, @Brickwizard. That's a fine example of what Don't Break Debian tells us not to do.

Adding Spotify repository to your Debian installation can break Debian, even if Spotify claims to provide a "Debian repository". It's not Debian's, hence it falls 100% in the text I quoted from the Debian's Wiki itself.

As the package format and toolset is the same, replacing Debian for Kali, even if Spotify claimed to have a "Kali repository", it could break Kali for the same reasons. And most likely it did for OP.

If Kali doesn't have Spotify in its .deb repositories (Kali's, not what Spotify claims-to-provide-for-distribution), install a Flatpak / AppImage / Snap, or just don't install Spotify.
 
You're posting an example of how to break Debian,
Well I must be lucky then, I have been running Debian based distros on my main machine for around 12 yrs, and used Echo and apt commands to install some applications, As yet, I have not broken my installation, I have had a few installation failures, usually caused by dependencies. [but I do read the documentation first]
 
I was lucky too, for many years as well, but our relative success (you mention problems with dependencies) doesn’t prove the Debian Wiki wrong.

Don’t Break Debian is part of the official Debian documentation.

Reading the documentation as you do, and being the official documentation the source I am quoting, should lead you to agree with me.
 
"I'm trying to download Spotify but this gives error"

Do you mean that you have or have not downloaded Spotify?

Or, do you mean that you have downloaded Spotify but can't install it?

If you have tried to install it what method have you tried? Dpkg? Apt? Apt-get? Aptitude? Synaptic? Gdebi?

What does your sources list say and what are the contents of sources,list.d?

When you say "sudo apt-get update - upgrade" that is not a correct command. If you do "sudo apt update" and/or "sudo apt upgrade" what is the full error message you get. Please Copy and Post here in full so we can see
 

Steps to Install Spotify on Kali Linux?​


The easiest method that you can use to install Spotify on Kali Linux is to use a terminal. Unlike Ubuntu which uses the ubuntu software to download the required app. In Ubuntu software, you have launched it, by simply searching for Spotify, when it appears simply click on install. Since Ubuntu is a Linux Distro, you can also use Terminal to Install Spotify using the below command.

snap install spotify

Also, if you wish to Install Spotify on any other Linux Distro, first you must find out How to Install Snap first. For that visit their official website.
 
You have a broken installation because you have installed packages from sources other than your distribution's repository, or you interrupted an update after upgrading some packages but not all the dependencies.

Please use the search box and paste the message error, as this has been discussed plenty for other Debian derivatives.
i tried this but the problem continues
 
It is always best to install applications from your distribution repository [software manager] remove any previous installations first.

The alternative for Debian distributions is

configure the debian repository: from the terminal run.

curl -sS https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg

echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list


Then to install Spotify for Debian

sudo apt-get update && sudo apt-get install spotify-client
i tried this but the problem continues
 
Do you mean that you have or have not downloaded Spotify?

Or, do you mean that you have downloaded Spotify but can't install it?

If you have tried to install it what method have you tried? Dpkg? Apt? Apt-get? Aptitude? Synaptic? Gdebi?

What does your sources list say and what are the contents of sources,list.d?

When you say "sudo apt-get update - upgrade" that is not a correct command. If you do "sudo apt update" and/or "sudo apt upgrade" what is the full error message you get. Please Copy and Post here in full so we can see

i try to download but it gives me this error.

The following information may help to resolve the situation: The following packages have unmet dependencies: spotify-client : Depends: libgconf-2-4 but it is not installable Recommends: libavcodec58 but it is not installable or libavcodec-extra58 but it is not installable or libavcodec57 but it is not installable or libavcodec-extra57 but it is not installable or libavcodec-ffmpeg56 but it is not installable or libavcodec-ffmpeg-extra56 but it is not installable or libavcodec54 but it is not installable or libavcodec-extra-54 but it is not installable Recommends: libavformat58 but it is not installable or libavformat57 but it is not installable or libavformat-ffmpeg56 but it is not installable or libavformat54 but it is not installable E: Unable to correct problems, you have held broken packages.
 
The most important thing at the moment is
E: Unable to correct problems, you have held broken packages.
I usually use
sudo apt update && apt --fix-missing

Followed by
sudo apt update && apt upgrade
 

Members online


Top