LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   manually fixing dependencies (https://www.linuxquestions.org/questions/debian-26/manually-fixing-dependencies-560677/)

144419855310001 06-10-2007 03:00 PM

manually fixing dependencies
 
Hi

I've actually just installed ubuntu 7.04 amd64, but I figured the Debian forum might be a better bet for a question about using apt-get flags and CLI.

I would like to know how to use dpkg / apt-get with reference to manually clearing up dependencies.

Firstly, how do I get apt-get to install a local deb and resolve its dependencies?
On Fedora, I would have done:
Quote:

yum localinstall xyz.rpm
However, when I tried to install some local debs with dpkg, e.g. (for a i386 deb I was trying to install):
Quote:

dpkg -i --force-architecture localdeb.deb
I ran into a dependency problem, and there doesn't seem to be any such flag as "localinstall" for apt-get to allow me to do a similar operation to that of yum above.

Trying (the only thing I could think of):
Quote:

apt-get -f install localdeb.deb
results in:
Quote:

E: Couldn't find package localdeb.deb
What should I do?


Secondly, another question in regard to resolving dependencies. I was trying to compile a program, and one of the problems with ./configure for example was
Quote:

checking for xml2-config... no
...How would I use apt-get to find which .deb package I need to install in order to provide e.g. xml2-config?


Thanks

baikonur 06-11-2007 05:15 AM

first of all, you make life easier on yourself if you use aptitude, not apt-get.
Quote:

Originally Posted by Debian Reference
aptitude is now the preferred text front end for APT, the Advanced Package Tool. It remembers which packages you deliberately installed and which packages were pulled in through dependencies; the latter packages are automatically de-installed by aptitude when they are no longer needed by any deliberately installed packages.

dpkg can install local files right after you downloaded them to your Desktop (or wherever you put them) but it lacks automatic dependency resolution, as opposed to apt, so either install all the missing packages manually with dpkg or create your own repository to use with apt. I'd do the latter. Like this:

Quote:

Originally Posted by Debian Reference
# aptitude install dpkg-dev
# mkdir /usr/local/debian
# mv /some/where/package.deb /usr/local/debian
# dpkg-scanpackages /usr/local/debian /dev/null | \
gzip - > /usr/local/debian/Packages.gz
# echo "deb file:/usr/local/debian ./" >> /etc/apt/sources.list

Read more here:
http://www.debian.org/doc/manuals/re...ackage.en.html

hope this helps

ErrorBound 06-11-2007 02:54 PM

Quote:

Originally Posted by 144419855310001
...How would I use apt-get to find which .deb package I need to install in order to provide e.g. xml2-config?

If you have access to a browser it's easier just to use http://packages.ubuntu.com . Scroll down to "search the contents of packages" and put xml2-config in that. You will find that it is included in the package libxml2-dev :cool:

144419855310001 06-11-2007 05:48 PM

Thanks guys, that's great.

144419855310001 06-12-2007 08:36 AM

Hi

I have another question.

I have been trying to use aptitude to install a package. However, whenever I try to do so, aptitude keeps on trying to install different packages in order to fix some broken dependencies for a certain couple of completely different packages.

However, I want these two packages to remain broken (I'm using a compiled version of the missing dependency, instead of a .deb).

Although I like the fact that aptitude tries to fix broken dependencies generally, I would like to have it stop bothering me about the dependency for these particular 2 packages whenever I try to install something!

How can I do so?
Thanks

nx5000 06-12-2007 08:40 AM

Quote:

Secondly, another question in regard to resolving dependencies. I was trying to compile a program, and one of the problems with ./configure for example was
Quote:
checking for xml2-config... no

...How would I use apt-get to find which .deb package I need to install in order to provide e.g. xml2-config?
If you need to compile a debian package:
Code:

apt-get build-dep <package>
apt-get source <package>
cd packageXXX
debian/rules binary


For getting dependencies of a .deb , there is an automatic tool but I can't find it..

otherwise, just do something like this
Code:

cd /tmp
ar x /path/to/debfile
gzip -d /tmp/xxx/Control  (can't remember exactly the name)

You will get a file containing the dependencies for the binary and for the source.

nx5000 06-12-2007 08:49 AM

I think for your dependency, you could use this.

Dirty way:
Go in /var/cache/apt, modify the control file of the package to remove the unwanted dependencies.

baikonur 06-12-2007 08:55 AM

Quote:

Originally Posted by 144419855310001
Although I like the fact that aptitude tries to fix broken dependencies generally, I would like to have it stop bothering me about the dependency for these particular 2 packages whenever I try to install something!
Thanks

i would create deb packages of these two, install them via your local repository and if thats not enough, put a hold on them. (in aptitude's ncurses interface, with [=] )

144419855310001 06-12-2007 08:58 AM

I'd rather not have to bother creating a .deb out of this program I've compiled in order to meet the dependency.

Surely there must be some configuration file I can alter in order to ignore the dependency problem of the 2 packages aptitude insists on trying to fix?

nx5000 06-12-2007 09:07 AM

It's the "dirty way" in my previous post. Never tried it though..

Is it possible to put on hold an uninstall package? Hum..
Also in /etc/apt/preferences you could forbid the dependencies version.

Now you have 4 or 5 methods, choose :)

baikonur 06-12-2007 10:20 AM

Quote:

Is it possible to put on hold an uninstall package? Hum..
no, can't put hold on purged packages. (just tried, because i was curious myself :))
manipulating the control file is probably justified in this situation... i wouldn't make a habit of it, though ;)


btw,
Code:

man -k dependenc
yielded
Code:

dpkg-checkbuilddeps -B [control file]
as a tool to find the deps.

144419855310001 06-12-2007 11:08 AM

Not being too familiar with debian, equivs looked the most understandable, and it seems to have fixed the problem very nicely.

Thank you!

( for anyone else reading this, the howto is here:
http://www.debian.org/doc/manuals/ap...elpers.en.html )


All times are GMT -5. The time now is 11:54 PM.