DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
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?
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.