1

This question already has an answer here:

Most distros have a package manager which allows you install programs quite effortlessly. For packages with source, you could always compile youself. Are there are notable differences between the results of compiling by hand and installing a package? (assume the code base is the same)

marked as duplicate by Kusalananda, jasonwryan, sam, Jeff Schaller, Julie Pelletier Feb 1 '17 at 23:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • If you compile and install manually, your package manager knows nothing about the files you have installed. – jasonwryan Feb 1 '17 at 21:50
  • There is also a possible difference in the options you enable versus those present with the package manager. This can result in compatibility issues with other packages. – Julie Pelletier Feb 1 '17 at 21:51
  • Compile what sources? Those from the packages from the package manager? Note that these might in some cases differ from the original sources, e.g. in the case of OpenSSL the Debian package might have a bit different random number generation. – phk Feb 1 '17 at 21:53
1

Are there are notable differences between the results of compiling by hand and installing a package? (assume the code base is the same)

There are all kinds of compile-time flags that can be used to tune the resulting binaries; for example, in order to disable certain features or optimize for code size instead of speed.

Also, the convention used by many packages with a configure-driven build system is that when you install manually the package goes in /usr/local by default as opposed to /usr.

Gentoo compiles from source. You get the convenience of a package manager without sacrificing any flexibility (you can always tweak an ebuild in a local overlay).

  • 2
    The ready-built packages may also incorporate distribution-dependent patches. – Kusalananda Feb 1 '17 at 22:00
  • @Kusalananda I was going to mention that, but OPs question included "assume the code base is the same". – DepressedDaniel Feb 1 '17 at 22:14
1

... the answer is very simple, is that the program already compiled, "ready to run" follows a pattern, memory, processor, file system and so on ... already with the source code, to compile besides Allow you to make your changes! If you wish! ", The program produced will be more efficient precisely because of this it was made, created compiled in your machine, then you know it very well, ie memory, video, disk, etc ... and almost the same as you Buy a suit in a store in an already standardized measure or go in a tailor and order one with your measurements, which is much more fair and comfortable.

1

The binaries resulting from compiling the source yourself is probably not going to differ much (depending on compiler flags and distro patches) from what you get in a package.

The package will come with a lot of convenient extras which normally aren't handled by the traditional configure, make, make install dance:

  • Easy method of upgrading
  • Easy method of uninstalling a package. Some projects include the option of running make uninstall, but not all and they require you to keep the sources around for all installed software
  • Automatic installation of dependencies. Packages depend on other packages which the package manager will install for you. You will have to install the correct dependencies yourself before being able to compile the code
  • Unit files for SystemD or scripts for init.d will be installed by the package
  • Default directories, configuration files, users, and groups will be created

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