Hi,
You might consider asking this question in the distro. forum
for the Mandriva distro.. The answer to your question can get
kinda distro specific. Ill try to help here though.
For questions 1 and 2 - This can be pretty tough, especially if
you do a full install. How to determine if a library ever gets used
is a separate question to ask in the forums. I do not know how
at the moment. Making sure that appropriate apps appear in the
menus is tedious but can be done. The thing here is to know
what all apps you install. This is the reason doing a full install
can make you task kinda tough. For the most part, modern
installation programs can tell what libraries you need based on
your selections at install time.
Most Linux distros are pretty clean out of the box. The thing to
watch is /tmp. It can grow quiet a bit over time. Also, the .
directories in your home directory. For ex. .mozilla . Apps like to
put temp data in those.
If your really serious about knowing what is on your system and
keeping it under control, try
www.linuxfromscratch.org.
Question 3 - always format after a failed install. That will fix that
problem.
I know this is not much help, but, you have asked a very large and
broad question. If you find lots of ways to go about keeping
your system clean, you may want to write a how-to on this topic.
If you have this question, chances are that other do to. If your
a programmer, you should consider writing a program that helps
people do this.
Good luck,
Michael