LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   How to fix broken package (https://www.linuxquestions.org/questions/ubuntu-63/how-to-fix-broken-package-904637/)

joboy 09-23-2011 11:21 AM

How to fix broken package
 
I am testing version 11.10 and got broken package problem when try to install some package, I try to fix it with synaptic but failed with the following message :

E: Unable to correct problems, you have held broken packages.
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies


What should I do ?

andrewthomas 09-23-2011 12:16 PM

Are you sure that this in not the result of a "partial-upgrade?"

First clean & update

Code:

sudo apt-get clean && sudo apt-get update
Then post the full output of

Code:

sudo apt-get upgrade

joboy 09-23-2011 12:20 PM

I am not sure, but yes that fixed the problem thanks.

andrewthomas 09-23-2011 12:24 PM

You're welcome.

Glad to be of help.

dileep.durgasi 11-16-2011 12:25 AM

Does "apt-get clean" will fix the dependency issue or is there any other process to fix dependencies issue on Linux.

fortran 11-16-2011 03:55 AM

Go to synaptic package manager.
Edit > Fix broken Packages.

widget 11-16-2011 04:46 AM

Clean is just a way to recover space. From "man apt-get";
Quote:

clean
clean clears out the local repository of retrieved package files. It removes everything but the lock file from
/var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When APT is used as a dselect(1) method, clean is run
automatically. Those who do not use dselect will likely want to run apt-get clean from time to time to free up disk space.
In answer to the OP in this long dead thread they ran that, a good idea particularly in a dev release as there are a lot of upgrades everyday, along with an update. Then an upgrade.

The update/upgrade corrected the dependency problem, probably because the OP used Update Mangler to upgrade a dev system. This is not a good idea. I don't ever use UM as I don't trust it a bit.

If you have a problem along this line with a broken package the first thing to try is, as root;
Code:

dpkg --configure -a
which will try to install any package not properly installed in a gentle way.

If this does not work try, again as root;
Code:

apt-get install -f
no package just the command as written there. This will attempt, with brute force to install the package(s).

If those do not do it you can study the man page for dpkg or ask on the forum as you have a "special" problem. One or the other of the above should do the trick.

That is basically what Synaptic is invoking with its broken package script. It works pretty well but when you have this type of problem sometimes (probably all times) it is a good idea to do this without X running which kind of kills the option of Synaptic.

I assume you are using Ubuntu so just booting to recovery will bring you to a root prompt. You don't even have to use a password due to the wisdom of the fine Ubuntu devs who very helpfully disabled the login for the root prompt. I know that anyone wanting to get into your box will appreciate that thoughtful, helpful attitude toward security.

Just run those commands there. And hope no one gets access to your box because it is wide open. From that prompt it is easy to set a new user or to change the password for the current user.

You might want to put a password in grub to prevent folks from getting to the recovery mode. Will at least slow them down.

gbra1988 04-28-2012 02:15 AM

Hi,
I'm also new to ubuntu and I had the same problem with one package.I use Ubuntu 11.10. After days of forums I tried aptitude and worked:

sudo aptitude install [package]

it is better that you are logged as root to function better:

sudo su
aptitude install [package]

Than follow the steps and that's it, you're done.

I hope this helps

ionraedt 05-18-2013 04:08 PM

How to fix broken package - gstreamer1.0-plugins-bad
 
I cannot fix the broken "gstreamer1.0-plugins-bad"

1) Trying with synaptic results in Errors:
E: Unable to correct problems, you have held broken packages.
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

2) Trying apt-get clean && sudo apt-get update, sudo apt-get upgrade, dpkg --configure -a and apt-get install -f doesn't fix the package, only the message "0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded" is didplayed.

3)Finally, with aptitude, I get this result:

root@ivo-medion17:/home/ivo# apt-get install aptitude gstreamer1.0-plugins-bad
Reading package lists... Done
Building dependency tree
Reading state information... Done
aptitude is already the newest version.
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:
gstreamer1.0-plugins-bad : Depends: libgles2-mesa (>= 7.8.1) but it is not going to be installed or
libgles2
E: Unable to correct problems, you have held broken packages.

BTW, libgles2-mesa is also reported broke by synaptic and cannot be installed.
I am really out of ideas now, can somebody help ?

widget 05-18-2013 06:38 PM

If you were trying to install your package using aptitude that is not the command to use at all. Aptitude is not a function for apt-get. It is a package manager.

As root the command would be;
Code:

aptitude install gstreamer1.0-plugins-bad
I would us the purge command first and then try installing with aptitude. This should give you some alternative routes to take. Do not take the first one. For that matter keep refusing all alternatives until it runs out of them. The run the install command again and take the best one you saw out of all of them the first time around.

ionraedt 05-20-2013 09:39 AM

Hi Widget
I followed your instructions.
I used "aptitude install" and chose the second route (not knowing where the other routes would lead to)
Package "gstreamer1.0-plugins-bad" was installed and works !
"Skype" and "Wine" were uninstalled.
I reinstalled Skype (with Ubuntu Software Center) and it works fine with my old settings.
I suppose that reinstalling wine will also be enough to use some old windows progs again.
Thanks again for your help, you're a genius !

yoramdavid 06-08-2013 05:45 AM

Hi,

I followed this threat to the end but it did not work for me: I am trying to install f4l.
Quote:

sudo apt-get install f4l
Os pacotes a seguir têm dependências não satisfeitas:
f4l : Depende: libqt3-mt (>= 3:3.3.8-b) mas não é instalável
E: Não foi possível corrigir problemas, você tem pacotes mantidos (hold) estragados.
It says it depends on libqt3-mt but is not installable.

I tryed to fix it with synaptic but it failed with the following message :

Quote:

E: Unable to correct problems, you have held broken packages.
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
I then tried the following:
Quote:

sudo apt-get clean && sudo apt-get update
Which seemed ok. No errors reported.

Then
Quote:

sudo apt-get upgrade
Which upgraded some packages and reported no errors.

Quote:

sudo dpkg --configure -a
Does nothing visible.

Quote:

sudo apt-get install -f
0 pacotes actualizados, 0 pacotes novos instalados, 0 a remover e 2 não actualizados.
Did not do much.

The command:
Quote:

sudo aptitude install f4l
Only gave me one choice:
Quote:

Os seguintes NOVOS pacotes serão instalados:
f4l{b}
0 pacotes actualizados, 1 novos instalados, 0 para serem removidos e 2 não actualizados.
É preciso obter 369 kB de ficheiros. Depois de desempacotar serão utilizados 1503 kB.
Os seguintes pacotes têm dependências não satisfeitas:
f4l : Depende: libqt3-mt (>= 3:3.3.8-b) o qual é um pacote virtual.
As seguintes acções irão resolver estas dependências:

Manter os seguintes pacotes na sua versão actual:
1) f4l [Não Instalado]



Aceitar esta solução? [Y/n/q?] n

*** Sem mais soluções disponíveis ***
Which means: it installs f4l, it says it has an unsatisfied dependency with libqt3-mt which is a virtual package.
The solution is: Maintain the package on its actual version: f4l.
Then it seems to do something, but f4l does not get installed.

Thanks.
Yoram

widget 06-08-2013 06:43 PM

Quote:

Originally Posted by yoramdavid (Post 4967693)
Hi,

I followed this threat to the end but it did not work for me: I am trying to install f4l.

It says it depends on libqt3-mt but is not installable.

I tryed to fix it with synaptic but it failed with the following message :



I then tried the following:

Which seemed ok. No errors reported.

Then

Which upgraded some packages and reported no errors.


Does nothing visible.


Did not do much.

The command:

Only gave me one choice:

Which means: it installs f4l, it says it has an unsatisfied dependency with libqt3-mt which is a virtual package.
The solution is: Maintain the package on its actual version: f4l.
Then it seems to do something, but f4l does not get installed.

Thanks.
Yoram

This has nothing to do with the OP (Original Post).

You should start a new thread.

People use forum search when looking for solutions. Threads should, therefore, cover only one subject so that they will be seachable.

shadotu 09-20-2013 02:23 PM

fix brokjen packages
 
had the same problem with vlc on kali linux. solve the problem by purging the offending dependancies
sudo apt-get install purge (broken dependancy goes here)
do that for every dependancy then install the program using
apt-get install (name of program here)

sj738 01-02-2014 03:11 PM

how to fix broken packages
 
Quote:

Originally Posted by andrewthomas (Post 4480338)
Are you sure that this in not the result of a "partial-upgrade?"

First clean & update

Code:

sudo apt-get clean && sudo apt-get update
Then post the full output of

Code:

sudo apt-get upgrade

[INDENT] Very helpful! "Old" questions give me new insight, thanks!

hereticus 03-20-2014 08:45 PM

Thanx. I broke one of my rules for a fresh install.
 
I tried to install packages before installing revisions. This fixed my problem.

Fernando Macias 06-16-2014 03:39 AM

fixing dependency problems
 
After an arguous bout with this problem I found what worked for me was simply to remove the problem and start over by reinstalling the package. Here is how I removed the package. sudo apt-get autoremove <package name> Then I simply reinstalled it.

hope this helps.

eredwood007 06-12-2016 12:28 PM

This post work for me even today.
 
Just wanted to say that this post is still relevant today (6/12/16). Thank you all for all that you do. I help me install owncloud-client.



Quote:

Originally Posted by sj738 (Post 5090809)
[INDENT] Very helpful! "Old" questions give me new insight, thanks!


drackg 10-24-2016 10:40 AM

help..
 
please can you describe how did you fix synaptic packages. because probably you did same with owncloud-client - install it on raspbian - wheeze light - debian easy installation.

many thanks

rasto

EDIT: who wants to install owncloud client on raspbian and met with problem of packages to be fixed, stop and follow this manual

https://wiki.sgripon.net/doku.php/bu...r_raspberry_pi

sergioabreu 01-05-2017 05:34 AM

Easy, depending on the problem : )
 
Just remove the app and broken related packets... for in sequence to do a complete reinstall
In my case when I tried to add vim-gtk, the system complained about vim-common and vim-runtime

# Removing:
sudo apt-get remove --purge vim
sudo apt-get remove --purge vim-common
sudo apt-get remove --purge vim-runtime

# refresh repositories (optional)
sudo apt-get update

# reinstall
sudo apt-get install vim

aaquib 04-13-2017 06:15 AM

i was having a "partial-upgrade' but i followed the your step.now what should i do to recover ?


All times are GMT -5. The time now is 07:00 AM.