LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Continuing to upgrade and install new packages with broken dependencies in the system (http://www.linuxquestions.org/questions/debian-26/continuing-to-upgrade-and-install-new-packages-with-broken-dependencies-in-the-system-560870/)

nautilus 06-11-2007 09:22 AM

Continuing to upgrade and install new packages with broken dependencies in the system
 
Hello.

I have intentionally installed a package with missing dependencies (dpkg -i --ignore-depends=...) and now I cannot upgrade my system unless I fix the dependencies:

Quote:


root@mymachine:/root/# apt-get upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
You might want to run `apt-get -f install' to correct these.
The following packages have unmet dependencies:
opennms-webapp: Depends: tomcat4 (>= 4.1.18) but it is not installable
E: Unmet dependencies. Try using -f.

Of course apt-get -f install wants to remove the package with the broken dependency, so this solution is out of question.

What I would ideally want to do is to tell to the system to keep going without caring about this broken dependency...

Is there a way to do this?

samael26 06-11-2007 09:36 AM

Hi,

Do a research on APT pinning. You can set a pin priority for a package
/etc/apt/preferences
Package: foo.deb --> your package
Pin: Release 1=MyOwn, version 1.2-3 --> your package version
Pin-Priority: 2000

Hope that helps.

nautilus 06-11-2007 11:22 AM

Hi samael26,

Thanks for your reply. If I got it right, you are suggesting I should pin the package with the broken dependency to its current version and try again, right?

What I've done is this:

Found the version of the package with broken deps:

Quote:

root@mymachine:/etc/apt# dpkg -l | grep opennms-webapp
ii opennms-webapp 1.2.8-1sarge open network monitoring and management appli
And created /etc/apt/preferences and added into it:

Quote:

Package: opennms-webapp
Pin: Release 1=sarge, version 1.2.8-1sarge
Pin-Priority: 2000
and here goes nothing:

Quote:

root@mymachine:/etc/apt# apt-get upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
You might want to run `apt-get -f install' to correct these.
The following packages have unmet dependencies:
opennms-webapp: Depends: tomcat4 (>= 4.1.18) but it is not installable
E: Unmet dependencies. Try using -f.

nautilus 06-13-2007 07:59 AM

Well. I found the solution!!! Here are two actually for people who might have the same problem with me:

SOLUTION 1 (worked for me):

Use equivs. This is a package that creates dummy debian packages to satisfy the dependencies if someone has installed something from source. Here is a helpful link:

http://www.debian.org/doc/manuals/ap...elpers.en.html

If your dependences are already broken and you cannot

Quote:

apt-get install equivs
do:

Quote:

aptitude install equivs
Most probably aptitude will suggest to remove the packages with the broken dependences. So when it asks you if you want to continue, note that the options are not just (Y/n) the are (Y/n/?). Just do ? to see what other options you have... One of them will be = which means hold the package... So your answer is:

Quote:

= <name of the broken package>
And now you have equivs!

SOLUTION 2 (didn't try it since the first one worked for me):

Just use aptitude (its ncurses version), find the package using /, and hold it using =

That is all folks!:D


All times are GMT -5. The time now is 02:20 AM.