LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 04-19-2007, 03:25 AM   #1
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Reinstalling a package and its dependencies


Reinstalling a package and its dependencies
How to do this?
I've been searching for months about this. IMO there is no solution but maybe somebody will prove me the opposite.
 
Old 04-19-2007, 05:48 AM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,673

Rep: Reputation: 122Reputation: 122
What is it you're trying to achieve? I know Synaptic has a "Reinstallation" option and so does aptitude (man aptitude). Or do you want to re-install all the dependencies as well?
 
Old 04-19-2007, 06:44 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 52
I have sometimes run into problems and reinstalling the package was a good way to get out of the problem.
Unfortunatly sometimes, I also had to reinstall one of its dependencies.

So I'm searching for a way to make a reinstall of a package and recursively reinstall its dependencies.

It's very easy as a script but maybe there is a way.
I will check aptitude. Synaptics I can't, I'm often without X.

Thanks
 
Old 04-19-2007, 07:00 AM   #4
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
The significant thing about aptitude is that it tracks the dependencies, so when you remove a program it removes all the dependencies as well ... as long as no other program is also dependent upon them.

This assumes that you both installed and removed the program using aptitude. This can lead to problems if you are installing/removing metapackages.

The first aptitude command should be # aptitude keep-all, and then you have to consider strongly using it exclusively. Long discussion here.
 
Old 04-19-2007, 07:09 AM   #5
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
The significant thing about aptitude is that it tracks the dependencies, so when you remove a program it removes all the dependencies as well ... as long as no other program is also dependent upon them.
I've heard about that, but never quite got to use aptitude as I occasionally use other tools as well (like apt-get). Is it the same thing as if you use apt-get remove to remove some packages and then apt-get autoclean (was it that word?) which removes packages that are "no more needed" as it says?
 
Old 04-19-2007, 07:39 AM   #6
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
Quote:
Is it the same thing as if you use apt-get remove to remove some packages and then apt-get autoclean
Autoclean is entirely different. If you removed a program with apt-get, leaving the dependencies, you could use deborphan to identify the no longer used packages and then remove them.
 
Old 04-19-2007, 08:49 AM   #7
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 52
I always use aptitude now.
but

aptitude reinstall apache2 only reinstall apache2

apache2:
Depends: apache2-mpm-worker (>= 2.2.3-4) | apache2-mpm-prefork (>= 2.2.3-4) | apache2-mpm-event (>= 2.2.3-4)

I want to also reinstall one of these 3 (currently the package apache2-mpm-prefork), and so on ; but not the libc

Hummm I am asking too much again?
 
Old 04-19-2007, 09:25 AM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
With apt-get you could explicitly remove one (or more) of the dependencies, and by adding the purge option, force it to get a new .deb and install. You could check the full list of dependencies for the package, and remove them all, then by installing the package, all the dependencies would be rebuilt.

I don't use aptitude myself, but I rather expect the same functionality would be there.

Peace,
JimBass
 
Old 04-19-2007, 10:47 AM   #9
mastrboy
Member
 
Registered: Aug 2005
Distribution: Debian, OpenBSD, PFsense
Posts: 73

Rep: Reputation: 15
sometimes it might be enough to just run a dpkg-reconfigure packagename
 
Old 04-19-2007, 10:56 AM   #10
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 52
Yes yes I know, I'm not looking for alternatives. Thanks
I'm looking for how to reinstall a software (package and dependencies)
 
Old 04-19-2007, 11:18 AM   #11
BillyGalbreath
Member
 
Registered: Nov 2005
Location: Houston Texas
Distribution: Debian Sid
Posts: 379

Rep: Reputation: 31
Why not do it manually? If you know the dependancies, just remove them when you remove the parent package. I've never heard of a way to reinstall a package _and_ its dependancies in one smooth step. Would be a great tool if it existed. Someone should look into creating this.
 
Old 04-19-2007, 11:42 AM   #12
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by BillyGalbreath
Why not do it manually? If you know the dependancies, just remove them when you remove the parent package. I've never heard of a way to reinstall a package _and_ its dependancies in one smooth step. Would be a great tool if it existed. Someone should look into creating this.
Same here, I've never seen such a tool. I'm thinking now that it's probably too invasive. Imagine all what can get reinstalled.
But in theory, reinstalling a package doesn't cause harm.

Ok here's my awfull script (or call it virus)

Code:
#!/bin/sh
#v0.1
aptitude -s reinstall $1
list=$(apt-cache show $1 | sed -e '/^Depends/!d' -e 's/.*: //' -e 's/([^)]*)//g' -e 's/|//g' -e 's/,//g' -e 's/libc6//g' -e 's/ *$//' -e 's/^ *//')
[[ x$list == "x" ]] && exit
echo "for $1: $list"
for i in $list; do $0 $i; done
Argg doesn't work and too simplistic. Needs to be sorted and the exit condition has to launch the reinstall.
Also this script made me discover things I didn't know. Circular dependencies.
debconf depends on debconf-i18n
debconf-i18n depends on debconf
=>
script loops

We need to add Artificial Intelligence
(or perl but I'm not fluent in perl)

./script apache2 gives this:
Quote:
for apache2: apache2-mpm-worker apache2-mpm-prefork apache2-mpm-event
for apache2-mpm-worker: libapr1 libaprutil1 libdb4.4 libexpat1 libldap2 libpcre3 libpq5 libsqlite3-0 libuuid1 apache2.2-common
for libapr1: libuuid1
for libaprutil1: libapr1 libdb4.4 libexpat1 libldap2 libpq5 libsqlite3-0 libuuid1
for libapr1: libuuid1
for libldap2: libgnutls13 libsasl2-2
for libgnutls13: libgcrypt11 libgpg-error0 liblzo1 libopencdk8 libtasn1-3 zlib1g
for libgcrypt11: libgpg-error0
for libopencdk8: libgcrypt11 libgpg-error0 zlib1g
for libgcrypt11: libgpg-error0
for libsasl2-2: libdb4.2
for libpq5: libcomerr2 libkrb53 libssl0.9.8
for libkrb53: libcomerr2
for libssl0.9.8: zlib1g debconf debconf-2.0
for debconf: debconf-i18n debconf-english
for debconf-i18n: debconf liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl
for debconf: debconf-i18n debconf-english
How to reinstall your complete debian in a script

Last edited by nx5000; 04-19-2007 at 12:28 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
reinstalling kde with dependencies asdir Linux - Desktop 3 01-21-2007 08:46 AM
Package Dependencies newinlinux Slackware 5 09-01-2005 10:23 AM
Reinstalling LFS For Every New Package? g3neration Linux From Scratch 2 01-04-2005 02:51 AM
Package dependencies Ytsejammer Linux - Software 2 12-24-2004 09:59 AM
reinstalling a package Cyric Slackware 4 10-02-2004 12:01 PM


All times are GMT -5. The time now is 08:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration