Читать книгу Mastering Linux System Administration - Richard Blum - Страница 68

Real World Scenario INSTALLING SOFTWARE FROM SOURCE CODE

Оглавление

If you develop or work with open source software source code much, there's a good chance you will still find software packed up as a tarball. This section walks you through the process of unpacking and installing a tarball software package.

For this example, the GNU software package hello will be used. The hello package is a simple program that produces a “Hello World!” output but demonstrates how GNU packages source code files for distribution.

1 Download the hello tarball package to your Ubuntu server. Go to the GNU software download website ftp.gnu.org/gnu/hello/. Click the link to download the current version of the package. The current filename is hello‐2.10.tar.gz.

2 Unpack the software tarball using the command tar ‐zxvf hello‐2.10‐tar.gz. This command will create a directory named hello‐2.10 and unpack all of the files into that directory.

3 Change to that directory by typing cd hello‐2.10. In this directory, you should see a README and an INSTALL file. It's important to read these files. In these files will be instructions you will need to finish the software's installation.

4 Run the configuration script by typing the command ./configure. You will see output messages as the script scans your system to check for the appropriate tools for building the software. If anything goes wrong, the configure step will display an error message explaining what's missing from your system.

5 Compile the application by typing make. You should see a lot of messages scroll by as the script compiles the individual pieces of the application, but you shouldn't see any error messages. When the make command is finished, you'll have the actual hello software program available in the directory! However, it's somewhat inconvenient to have to run it from that directory. Instead, you'll want to install it in a common location on your Linux system.

6 Install the application by typing sudo make install. Now the hello application is installed on your Linux system.

Unfortunately, uninstalling an application installed by source code may or may not be easy. It's up to the developers whether to include an uninstall make script. Try running the sudo make uninstall command from the software directory to see whether that works.

Mastering Linux System Administration

Подняться наверх