< Day Day Up > |
Recipe 4.4. Installing Programs from Source Code4.4.1 ProblemYou want to install a program from source code, but you're having trouble navigating the thickets of tarballs, makefiles, and bunzips. 4.4.2 SolutionUnpack the tarball (compressed archive), then configure, make, and install the program. Start in the directory where you store your tarballs and source trees. This example uses JOE (Joe's Own Editor): # cd /usr/src/downloads # tar zxvf joe-2.9.8.tar.gz # cd joe-2.9.8 # ls # less README # less INFO # ./configure —help # ./configure <options, if needed> # make # make install | tee joe-makeinstall The last command stores the installation output in the text file joe-makeinstall. Some programs are archived with the bunzip2 utility, rather than the more traditional gzip. This is how to unpack a .bz2 archive: # tar jxvf joe-2.9.8.tar.bz2 To uninstall a source-built program, use: # make uninstall Uninstalling works only if the program author included a make uninstall option. Piping the output of make install to a text file gives you a reference if you have to remove all the files manually. Or generate a list using Recipe Recipe 4.3. 4.4.3 DiscussionThe steps described in this section are the standard way of installing programs from source code. However, not all program authors follow the same procedures. Be sure to review all the program documentation first. Studying your configure options is the most important part. Some programs, like Apache, have dozens of compile-time options. For prudent basic security, you only want to compile in support for things you really need. This is most important on servers that are exposed to untrusted networks, such as web and mail servers. Good reasons to compile programs from source are:
The bad part:
Some servers should be built from sources. For example, an Apache web server really needs to be source-built to get full customization and optimization. For a desktop system, forget it. They're too big and complex. Use the nice package-based Linux distributions for these. 4.4.4 See Also
|
< Day Day Up > |