[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Extension for dpkg -r



Hello,

We recently had an argument on the french debian users list about wether
it was possible to detect and remove automatically the packages that
were no more needed by the system.
E.g. If I install "sketch", it requires "python-base", "python-imaging"
and "python-tk" that I do not have. They will be installed.
But when I remove "sketch", the "python" packages will not be removed.

The solution we (french-users) thought of after days of discusion is the
following : when a package A is removed, we check all the packages B
that A was depending on. If any B is not used, it is "suggested" to
rmove it. For example, root could receive a mail telling him that B is
not vital anymore for the debian system. 

I wrote a shell script "called dpkg-remove" that takes in argument
package(s) name(s) and that tries to detect the "no more required"
packages after removal of these (it doesn't remove anything, of course.
Just checks)

E.g. Suppose I want to try "mozilla" :
	apt-get mozilla
It also installs "libnspr4". Now, I remove "mozilla" :
	dpkg -r mozilla
And then I can check for "packages not required anymore" :
	dpkg-remove mozilla
	 libnspr4
	 xcontrib
Of course, it can't detect wether a package is useful "by itself" or
not. That's why we should just mail root about the possibility to remove
it.

I think it could be a good idea to include this program in the "dpkg -r"
process. An other solution could be to ask "dpkg" to build a log of
removed packages and to run "dpkg-remove" by hand when we want to check
for unused. This could be easyly added in dselect, for example (between
5 and 6 !).
What do you think ? Do you want me to send you the programm ?

I hope you'll find my work useful,
Faithfully yours,

	Nicolas Sabouret



Reply to: