Unfortunately, you won’t be able to walk into the average computer store and find a lot of Linux application programs. The best way to get Linux applications (other than those included with your Fedora system) is to download them from the Internet. They can also be ordered on CD-ROM from several Linux Web sites.
Software packages that are specifically compiled and packaged for Fedora and other Red Hat Linux distributions are almost always available in RPM format. So when you begin scouring the Internet for Red Hat software (as described later in this chapter), look for software repositories of RPM packages built specifically for the version of Fedora Core that you are using.
More and more high-quality desktop applications are being packaged with Fedora Core, mostly as part of the GNOME or KDE desktop environments. In other words, to start finding some excellent office applications, games, multimedia players, and communications tools, you don’t have to look any further than the red hat menu button on your desktop.
So before you start hunting around the Internet for the software you need, see if you can use something already installed with Fedora. The chapters that follow this one describe how to use publishing tools, play games, work with multimedia, and communicate over the Internet — all with programs that are either on the DVD that comes with this book or are easily attainable. Appendix B contains a list of the software packages that are included with the complete version of Fedora Core that is packaged with this book.
To keep up with fixes to software packages that are part of the Fedora Core distribution, Red Hat offers a service for automatically downloading and installing packages. Chapter 10 shows you how to use up2date and the yum commands to update your Fedora Core software.
If you don't already know the names of applications you want to use, there are a lot of places to look for Linux applications on the Internet. If you do know what you want, your best bet might be to head for a software repository that has packages built specifically for Fedora.
Your best bet for getting high-quality, popular applications that are outside of the Linux distribution you are using is to go to a software repository that has created RPMs of the software that are particular to your distribution. Refer to the "Downloading and installing applications with yum" section later in this chapter for instructions on how to find and access yum repositories built for Fedora distributions.
Here are a few Web sites that you can browse to find detailed information about software that runs in Linux:
Freshmeat (www.freshmeat.net) — This site maintains a massive index of Linux software. You can do keyword searches for software projects or browse for software by category.
SourceForge (www.sourceforge.net) — This site hosts thousands of open source software projects. You can download software and documentation from those projects through the SourceForge site.
Tucows Linux site (linux.tucows.com) — Both free and commercial software for Linux is available from the Tucows Linux Web site. This site also features news articles on Linux and a listing of software downloads from the site by category.
When you purchase a commercial boxed application, you usually get the application on CD. Installation is often simplified, and hard copy documentation is provided. Of course, when you download software, you get immediate gratification — you don't even have to get up from your desk.
Sometimes software packages will be available in both libc5 and libc6 formats. This designation refers to the version of C programming-language libraries used by the application. If you have a choice, choose the libc6 packages. These are compatible with Red Hat Linux 7 and later (or any Linux kernel version 2.2 and higher). In fact, all major Linux distributions now use libc6. Better yet, look for packages designated for the specific distribution you are using (such as Fedora Core 3, Red Hat Linux 9, and so on).
You can visit FTP sites containing RPM packages if you already have some idea of what you are looking for. You can start by reading the README and INDEX files for a particular software product to get your bearings. Here are a few sites that are particularly good for finding RPM packages:
Fedora.us (www.fedora.us) — The Fedora project expects to make the Fedora.us site the recommended site for getting extra software packages to run on your Fedora system. Look for that site to become the official Fedora Extras site for getting quality software that is outside of the main Fedora distribution.
Livna.org (http://rpm.livna.org) — As an extension of the Fedora.us site, rpm.livna.org contains RPM software packages that are outside of the Fedora Project. This is the best place to get audio and video players (such as xine, mplayer, ffmpeg, ogle, and so on) that may not meet the licensing requirements adhered to by Red Hat, Inc.
Rpmfind (www.rpmfind.net) — Open source software that is already packaged in the RPM Package Management (RPM) format is available from this site. Do a keyword search from this Web site, then download the appropriate RPM from the search results.
FreshRPMs (www.freshrpms.net) — Another site with a good selection of high- quality RPMs.
Fedora Download Mirrors (http://fedora.redhat.com/download/mirrors.html) — Go to this page for a listing of download sites containing Fedora Core software that you can download. Most of these sites also have a variety of freeware and shareware applications that are usable with Linux.
Often, you can't just download a single software package to get the software in that package to work. Many packages depend on other packages. For example, software packages for playing audio and video typically rely on other software packages for decoding different kinds of content. To deal with this issue, Fedora Core has included the yum package.
The Yellow Dog Updater, Modified (yum) software package lets you install and update selected software packages in RPM format from software repositories on the Web. Once you know the software package that you want, yum is probably the best way to download and install that package.
The yum package is included on the Fedora Core DVD that comes with this book. To use yum to install RPM software packages, follow these basic steps:
Determine the software package you want. Many popular add-on packages for Fedora are already built for specific versions of Fedora Core and Red Hat Linux (Red Hat 8, 9, Fedora Core 1, 2, 3 and so on) and stored in software repositories on the Internet. The Fedora Project recommends you begin with repositories at Fedora.us and rpm.livna.org. A small list of yum repositories are also available from the yum Web site at http://linux.duke.edu/projects/yum/repos. You can click any of the repository names to display the exact information to copy and paste into your yum.conf file.
Configure yum. You need to configure the /etc/yum.conf file to point to the repository that contains the software you want. Then you can install any package that repository contains.
Run yum. The yum command can be used to download and install any package from the yum repository, including any packages the one you want depends on.
In Red Hat Linux, and so far also in Fedora Core, Red Hat, Inc. has gone to great lengths to ensure that software it provides is of good quality and unimpaired by legitimate patent claims. When you download packages outside of a Red Hat distribution of Linux, you are on your own to check the quality and legality of that software.
Besides downloading and installing new software packages, yum can also be used to check for available updates and list various kinds of information about available packages.
The /etc/yum.conf file already comes preconfigured to be able to install Fedora Core base system packages as well as updates. So, to update your system with packages that are part of the current Fedora Core release, you probably don't need to update yum.conf at all.
To be able to download from a repository that contains software that is not in a Fedora Core distribution, you need to add that repository to the /etc/yum.conf file. Here is an example of an entry in yum.conf that points to such a repository:
[freshrpms-fc-3] name=Freshrpms packages for Fedora Core 3 baseurl=http://ayo.freshrpms.net/fedora/linux/3/i386/freshrpms
In this example, for freshrpms-fc-3, the repository is named Freshrpms packages for Fedora Core 3. When you request a software package with yum, it looks in subdirectories of http://ayo.freshrpms.net/fedora/linux/3/i386/freshrpms.
As of this writing, the Fedora Core 2 repositories were not available from the location noted. Until they are, try http://ayo.freshrpms.net/fedora/linux/2/i386/freshrpms instead. If the yum repository listed here doesn't work, go to http://rpm.livna.org and look for valid entries for your /etc/yum.conf file from that page.
With the repository identified in your yum.conf file, downloading and installing an RPM you want is as simple as running yum with the install option to request the RPM. With an active connection to the Internet, open a Terminal window as root user.
The first thing yum does is download headers for all packages you might want from the repository. Then, after presenting you with the list of dependencies it thinks you need, it asks if you want to install the necessary packages. Here is an example of using the yum command to download the mplayer media player:
# yum install mplayer Gathering header information file(s) from server(s) Server: Fedora Core 3 Server: Freshrpms packages for Fedora Core 3 Finding updated packages Downloading needed headers Resolving dependencies ..Dependencies resolved I will do the following: [install: mplayer 1.0-0.9.20040415.1.fc3.fr.i386] I will install/upgrade these to satisfy the dependencies: . . . Is this ok [y/N]: y . . . Getting mplayer-fonts-1.1-1.fr.noarch.rpm Getting mplayer-1.0-0.9.20040415.1.fc3.fr.i386.rpm Calculating available disk space - this could take a bit mplayer-fonts 100 % done 2/14 mplayer 100 % done 14/14 Installed: mplayer 1.0-0.9.20040415.1.fc3.fr.i386 Dep Installed: mplayer-fonts 1.1-1.fr.noarch Transaction(s) Complete
As you can see from this example, yum checked three different software repositories: Fedora Core 3 (Base and Updates) and Freshrpms packages for Fedora Core 3. After listing the dependencies, yum asks if it is OK to install them. Type y and the package and all its dependencies are installed.
Besides downloading and installing new RPM packages, yum can also be used to list available packages and update packages that are already installed. The following examples illustrate some uses of yum.
# yum check-update
The check-update option causes yum to check the software repositories for available updated versions of RPM packages you have installed. If you see a package you want to update, you can use the update option. For example, to update the nmap-frontend package, you could type the following:
# yum update nmap-frontend
To update all packages that have updates available, type the following:
# yum update
If you want to see a list of all packages that are available for download from the repositories you have entered, type the following:
# yum list | less
Adding the less command to the end lets you scroll through the list of software (it could be long, depending on which repositories you point to). If you try to install a package and it fails with a message like "package xyzpackage needs xyzfile (not provided)" you can check for packages that include the missing file using the provides option as follows:
# yum provides missingfile
With the provides option, yum will search your repositories for whatever file you enter (instead of missingfile) and return the name of any packages it finds that include that file.
If you have configured your /etc/yum.conf file so that you are able to update your Fedora software packages, you can configure the yum service to get updates automatically going forward. The yum package includes a yum.cron file that you can set to run every day. This allows you to keep up-to-date with the latest Fedora software.
To get automatic updates with yum, all you need to do is start the yum service and set it to run every time you restart your computer. To do that, type the following (as root user from a Terminal window):
# /etc/init.d/yum start # chkconfig yum on
After you run those commands, once per day the yum command runs, first to get any updates to the yum package itself, then to get updates for any other Fedora packages that are available. To make sure that the service is running properly, check the /var/log/yum.log file. That file will show you what packages have been updated, when they were updated and if any errors occurred in the process.
The Fedora project does not offer software updates as a paid service. While, on the whole, the quality of updates from the Fedora project have been good, there is always a risk at getting automatic software updates on your computer. If you decide to turn on automatic updates with yum, be sure that you are using a valid Fedora yum repository and keep your eyes open for problems that may have come from installing a bad software package.
Instead of using yum to download and install software RPMS, you can simply browse for Linux software on the Internet and download it using a Web browser (such as Mozilla) or an FTP program (such as the ncftp command). The browser often enables you to view the contents of an FTP site through a Web interface (look for an index.html file in an FTP directory). An ftp command (such as ncftp) has more options, but is less intuitive. There are also GUI-based FTP applications, such as gFTP, to make FTP services easier to use. (The gFTP command is described in Chapter 9.)
The following procedures assume that you have a connection to the Internet.
To download a Linux software package from the Internet using Mozilla, follow this procedure:
From the desktop panel, start Mozilla.
Type the name of an FTP site that has Linux software in the location box and press Enter.
To move around the FTP site, click Up to Higher Level Directory to move up, or click on a directory to move down.
When you find a package that you want to install, position the cursor over it, click the right mouse button, and then select Save Link Target As.
In the Save As window, click the Go Up a Level button to move up, or click a directory to go down until you find where you would like to save the package.
As the package is downloaded to your computer, a dialog box displays the progress. Mozilla now has a nice, fairly new download manager that makes it easier to watch the progress of multiple downloads. When the download is complete, the application is ready to be uncompressed and installed (or simply installed if you have an RPM file).
If you want to use a text-based means of downloading files (instead of Mozilla), you can use any of several FTP commands that come with Red Hat Linux. One FTP client that I like to use is the ncftp command. (Other options are the ftp and lftp commands.) Here’s an example of an ncftp procedure:
From a shell or a Terminal window, type ncftp location, where location is the name of an FTP site. For example:
$ ncftp metalab.unc.edu
$ ncftp –u jake ftp://ftp.myveryownsrver.com
With no user name, as in the first example, ncftp logs you in as the anonymous user. (As an alternative, you could append the user name to the address. For example, jake@ftp://ftp.myveryownserver.com.)
With a user name (for example, -u jake), you are prompted to enter the password for that user at the FTP site.
When your login is accepted, you can use these commands to find the software package or document that you are looking for:
ls — To list the contents of the current directory.
cd dir — To change the current directory to the subdirectory dir. If you prefer, you can use two dots (cd ..) to go up a directory level. For example, try cd/pub/Linux/apps/doctools.
Type binary (to make sure the file is downloaded as a binary file).
To download a file from the current working directory, type get file where file is the application name. For example, to download the whichman application while /pub/Linux/apps/doctools is the current directory, type:
> get whichman-2.1.tar.gz
When the download is complete, type exit.
Before you start the ncftp command, make sure that your current directory is the one in which you want to download the file. Alternatively, you could change to the directory you want by using the lcd command within ncftp. For example, to change to /tmp/abcapp, type lcd/tmp/abcapp.
Whenever possible, you want to install the applications you use with Fedora Core from software packages in RPM format (files with a .rpm extension). However, if an RPM isn't available, the software that you want may come in other package formats.
Say you just downloaded a file from the Internet that contains lots of names, numbers, dots, gzs, and tars. What does all that stuff mean? Well, when you break it down, it’s really not that complicated.
Most of the names of archive files containing Linux applications follow the GNU-style package-naming conventions. The following example illustrates the package-naming format:
mycoolapp-4.2.3-1.i386.rpm mycoolapp-4.2.3.tar.gz mycoolapp-4.2.3.src.tar.gz mycoolapp-4.2.3.bin.SPARC.tar.gz mycoolapp-4.2.3.bin.ELF.static.tar.gz
These examples represent several different packages of the same software application. The name of this package is mycoolapp. Following the package name is a set of numbers that represent the version of the package. In this case, it is version 4.2.3 (the major version number is 4, followed by minor version number and patch level 2.3). After the version number is a dot, followed by some optional parts, which are followed by indications of how the file is archived and compressed.
The first line shows a package that is in the RPM Package Manager (.rpm) format. The .i386 before the .rpm indicates that the package contains binaries that are built to run Intel i386 architecture computers (in other words, PCs). The -1 indicates the build level (the same package may have been rebuilt multiple times to make minor changes). See the sidebar "Using Binary RPMs versus Building from Source" for the pros and cons of using prebuilt RPM binary packages as opposed to compiling the program yourself.
In the next two lines of the previous example, each file contains the source code for the package. The files that make up the package were archived using the tar command (.tar) and compressed using the gzip command (.gz). You use these two commands (or just the tar command with the -z option) to expand and uncompress the packages when you are ready to install the applications.
Between the version number and the .tar.gz extension there can be optional tags, separated by dots, which provide specific information about the contents of the package. In particular, if the package is a binary version, this information provides details about where the binaries will run. In the third line, the optional .src tag was added because the developer wanted to differentiate between the source and binary versions of this package. In the fourth line, the .bin.SPARC detail indicates that it is a binary package, ready to run on a SPARC workstation. The final line indicates that it is a binary package, consisting of statically linked ELF format executables.
Binaries created in RPM format are easily installed, managed, and uninstalled using Red Hat tools. This is the recommended installation method for Fedora Core novices. Sometimes, however, building an application from source code may be preferable. Here are some arguments on both sides:
RPM — Installing applications from an RPM archive is easy. After the application is installed, there are both shell commands and GUIs for managing, verifying, updating, and removing the RPM package. You don’t need to know anything about Makefiles or compilers. When you install an RPM package, RPM tools even check to make sure that other packages that the package depends on are installed. Because Red Hat has released RPM under the GPL, other Linux distributions also use it to distribute their software. Thus, most Linux applications are, or will be, available in RPM format.
Source code — Not all source-code packages are made into RPM binaries. If you use RPM, you may find yourself with software that is several versions old, when you could simply download the latest source code and run a few tar and make commands. Also, by modifying source code, you can tailor the package to better suit your needs.
Source code for RPM binary packages included with Fedora Core are included on the DVD that comes with this book. (The source code is also available on the CD set you can order using the coupon at the end of this book.) You can modify that source code yourself and rebuild the RPM binaries. The rebuilt binaries can be tuned to your hardware and include the features you want with the package. For more information on RPMs, refer to the Red Hat RPM Guide by Eric Foster-Johnson (Red Hat Press/Wiley, 2003).
Here is a breakdown of the parts of a package name:
name — This is generally an all-lowercase string of characters that identifies the application.
version — This is shown as major to minor version number from left to right.
src or bin — This is optional, with src usually implied if no indication is given.
type of binary — This is optional and can include several different tags to describe the content of the binary archive. For example, i386 indicates binaries intended for Intel architectures (Pentium CPU) and SPARC indicates binaries for a Sparc CPU.
archive type — Often tar is used (.tar)
compression type — Often gzip is used (.gz)
Many of the software packages that are not associated with a specific distribution (such as Fedora Core or Debian) use the tar/gzip method for archiving and compressing files. However, you may notice files with different suffixes at software project sites.
Table 5-2 describes the different file formats that you will encounter as you look for software at a Linux FTP site. Table 5-3 lists some of the common document formats that are used in distributing information in Linux.
.gz or .z
File was compressed using the GNU gzip utility. It can be uncompressed using the gzip or gunzip utilities (they are both the same).
File was archived using the tar command. tar is used to gather multiple files into a single archive file. You can expand the archive into separate files using tar with different options.
Tar and Gzip file
A common practice for naming files that are tar archives that were compressed with gzip is to use the .tgz extension.
File was compressed with the bzip2 program.
.taz or .tz
File was archived with tar and compressed with the UNIX compress command.
Linux Software Map
File contains text that describes the content of an archive.
Debian Binary Package
File is a binary package used with the Debian Linux distribution. (See descriptions of how to convert Debian to Red Hat formats later in this chapter.)
RPM Package Management
File is a binary package used with Fedora Core. Format also available to other Linux distributions.
File is in hypertext format for reading by a Web
browser program (such as Mozilla).
File is in PostScript format for outputting on a PostScript printer
File is in SGML, a standard document format. SGML is often used to produce documents that can later be output to a variety of formats.
File is in DVI, the output format of the LaTeX textprocessing tools. Convert these files to PostScript or Hewlett-Packard's PCL using the dvips and dvilj commands.
Files in Fedora without a suffix are sometimes plain-text files (in ASCII format). (One note of caution: A lot of the commands in Linux, such as those in /usr/bin and /usr/sbin, have no extension either. If you have a file with no extension, it’s best to use the file command on it before proceeding with any operation. In fact, using file on a previously untested file can prevent problems. A .txt file full of binary code could be used to exploit a text editor and do malicious things to the system.)
If you are not sure what format a file is in, use the file command as follows:
$ file filename
This command tells you if it is a GNU tar file, RPM, gzip, or other file format. (This is a good technique if a file was renamed and lost its extension.)