Does it make any difference (dependencies/installed software etc.) when gcc was installed before build-essential?

To be more specific, is it any difference between:

apt install gcc
apt install build-essential 


apt install build-essential
  • 2
    build-essential includes as a dependancy, gcc so the second version of commands will install gcc as part of installing build-essential. In short, there is no difference. – Charles Green Jul 24 '18 at 14:04

For the specific case of gcc and build-essential from the Ubuntu repositories, there is only one difference: Explicitly installing gcc (via apt install gcc or apt install gcc build-essential) marks it as manually installed. This means that using apt autoremove after uninstalling build-essential (and any other packages depending on gcc) will not remove gcc or any of its dependencies.

In the general case, nothing more can be definitely said about installing a dependency X first and then the dependent package Y. It's possible that X is one of many fulfilling the particular dependency, and installing Y directly could have caused another package to be installed instead of X.

See also:

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.