Installing Linux Software From Source Code
- Why install from source?
- Availability: a package for your distribution may not be available
- Optimization: the software can be compiled to take best advantage of your hardware
- Features: extra features can be enabled during the build process
- Download the source code "tarball". These archive files usually end with
.tar.gz or tar.bz2 suffixes.
- freshmeat.net
- sourceforge.net
- Unpack the source
- Using tar
- for *.tar.gz files:
tar xzvf
- for *.tar.bz2 files:
tar xjvf
- Using KDE: KDE's Ark utility is a graphical front-end for managing archives such as source tarballs
- Enter the source directory, using the
cd command
- Read the Instructions: instructions are usually contained
in the files named
INSTALL and README
inside the unpacked source directory
- Run
./configure
./configure --help to list the myriad available build options
- troubleshooting dependencies: the configure script will sometimes reveal
the need for another piece of software, such as a library,
which must be installed first
- Run
make
- Run
make install
- Superuser privegeles are required to install system-wide.
Regular users can install programs to their own home directories
- uninstalling
make uninstall: some source code comes with an uninstall target for the make command. This is often, but not always the case, and requires that you keep the source code, or at least the Makefile.
- manual removal: if the software doesn't have an
uninstall target, then it must be removed manually. This method is prone to error, and can result in cruft being left behind.
- Build a package
- Easy updating and removal: By making your package management system aware of the software you install from source code, packages and source installs can be seamlessly integrated.
- Using checkinstall:
checkinstall is a handy program that turns source code (or any other) installation into a package for your system. It knows how to make RPMs, debs, Slackpacks, and possibly other package types.