I'm relatively new to Linux but I've been messing around with a Ubuntu VM to get more acclimated with it. I set up SSH, Apache, PHP, MySQL, Ruby, Rails, Passenger, and Git to mess around with my web development projects. A few of those I built from source, PHP and Git off the top of my head.
I was wondering what the general best practice is for recompiling / reinstalling something from source is? For instance, if I wanted to update Git to a newer version or enable an extension for PHP. Is it ok to recompile it and then install it over the current installation? Or is that a no-no and I should be uninstalling first before reinstalling?
If the latter, how exactly do you go about uninstalling something that was installed from source?
I tried searching around a bit but this seems to be a hard question to search for and I couldn't find anything when building from source, only when using package managers.
Thanks for any help.
EDIT: Thanks for all the input so far. You all seemed to answer my question about uninstalling but the major question I was looking for an answer for was:
Whether or not I should uninstall something I built from source before I recompile and install it again. Or is it ok to install over current installations whenever I need to change a config flag or update to a newer version?