Another way of understanding what is happening if you have both packaged and source versions of the same program is to consider and example like this -
Say you're unhappy with the default program "ping" as provided by Debian (or any distro really). You could compile your own version of ping. You might just want to make your personal ping have a different name, like ping2 in order to be safe, but lets say you compile ping in /usr/local/ and it dumps a copy of your special ping in /usr/local/bin/.
Most of the time, this doesn't cause a problem. If you need the regular ping on your system, you call it with /bin/ping, and if you want your special ping, you call it with /usr/local/bin/ping.
But there is still a potential problem there. When I want to ping something, I don't call either /bin/ping or /usr/local/bin/ping, I just type ping and give it a name or address to ping and away it goes! How do you know which ping you're getting? Type this in a terminal:
You'll get the places (and order) that your system will look for programs. When I check my $PATH, I get this list -
Code:
jim@jimslaptop:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games
So the first place my machine looks for and program (in this case, ping) is in /usr/local/bin, then it would go to /usr/bin, then /bin, then finally /usr/games. Since my custom compiled ping is in /usr/local/bin, it will always be the first selected.
Again, most of the time that isn't a problem, but consider this example - say I compiled ping both to send huge pings (15 kilobytes instead of 64 bytes), and to send as many pings as possible rather than the 1 ping per second you get with normal ping. You are probably not the only person/program on your machine that uses ping. Say your GUI wifi program uses ping to check the connection with the AP you're associated with. If the code in that program says "ping $GATEWAY", it is going to use your modified ping, not the standard one. What happens when instead of sending three 64 byte pings to the AP in 3 seconds, because of your custom ping your wireless card sent four hundred 15000 byte pings in 3 seconds? Without seeing the code, you don't know what will happen. It might crash out your wifi GUI app, it might tell you that you have a great connection, or it might tell you that your connection is awful when its actually quite good. Now if the app called /bin/ping $GATEWAY instead of just ping $GATEWAY, then it would behave as it expects.
Since this is open source you could check for every call of ping on the system, and make sure they all specifically call /bin/ping if it is looking for specific results.
That shows that if you're going to custom compile something you also have installed by a package manager, you might want to give it another name. If the custom ping was named ping2, no programs would ever call ping2, unless you changed them to call ping2 explicitly.
That is also why when you're compiling software you have so many options on where libraries are located. Your system might have the libraries a program is looking for in /usr/lib, but you may have a (newer/older/compiled with different options than regular) version hiding in /usr/local/lib, or in /opt/lib, or anywhere you damn well please. The same way a golfer needs different clubs for different shots, a sysadmin may well need different libraries to get slightly different tasks accomplished.
Of course the options I described for ping don't actually need a custom compilation, you could get the size and speed modified at the command line with regular ping, I just did that for a quick example.
As to your dependency question, that's really a function of what it is that you're compiling on your own. If I compile the game "Battle for Wesnoth" on my own, it isn't going to break anything, because that is an app that sits on top of everything else. If I compile libc or some base level tool, that can and frequently will mess your whole world up. The abstract question, "is this a bad idea" is virtually worthless, particularly when you don't spell out specifically what the "this" is! That's also what made your question sound like homework, and probably what (in my opinion righteously) raised Telemachos' ire.
Peace,
JimBass