How can I replace a package installed via APT(or any other package managers) with the version from source without violating system? My problem is the same as this link, but I think the answer is not really helpful.
For example, I am trying to build a project that requires Clang (version 12.0.0+), but the latest version of Clang (APT) is 10.0.0, so apparently I have to install Clang from source (GitHub). So I have 3 questions:
- Should I need to remove the old Clang(APT)?
When I triedsudo apt remove clang
, the system also asked me to remove a lot of dependencies (REALLY IMPORTANT), and I think the system would corrupt if I remove Clang. - How can I set up the
PATH
so that the system will use the later version of Clang, because there are two versions of it in my laptop? - If a package is install via APT, it is very easy to update it via
sudo apt upgrade
. but how can I upgrade a package via git without reinstall it again? Every clang update takes me almost half a day to complete.