The wget utility is similar to Lynx in that it uses the HTTP protocol, but wget is a non-interactive HTTP download utility, so you'll need to know the exact URL of the file you want to download. To download the kernel source code tar ball, for example, with wget the command might look like this:
#wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-x.x.x.tar.gz
Where x.x.x is the kernel version number you want to download. wget will display a percentage complete counter using text on your terminal screen as it downloads the file using the HTTP protocol.
The command you need to enter next depends on the name of the file you downloaded. To be more specific, it depends upon the extension of the file name you downloaded. You probably are downloading files that look like this: filename.tar.gz or filename.tar.bz or filename.rpm.gz, and so forth. For the moment, we are only concerned with the final portion of the file name extension that is indicating the type of compression used by the file's creator to make the file smaller for transmission over slow networks. This extension and the command you need to use to uncompress the file will probably be one of the following:
.bz or .tbz | #bunzip2 filename.tar.bz | or | filename.rpm.bz |
.bz2 or .tbz2 | #bunzip2 filename.tar.bz2 | or | filename.rpm.bz2 |
.Z | #uncompress filename.tar.Z | ||
.gz | #gunzip filename.tar.gz | or | filename.rpm.gz |
.bz2.tar | #bzcat filename.bz2.tar | tar xv | or | filename.rpm.gz |
After issuing one of these commands on the file you downloaded, you should have a file with either a .tar or .rpm extension (in the same directory as the original file). We'll discuss how to handle these two types of files next.
The .tar portion of the file name indicates this is a tape archive file containing several files rolled into one. To untar the files in the tape archive, enter the command:
#tar xvf <filename>.tar
This normally creates a directory in the current directory (where the command is executed and where the file you downloaded resides) containing the uncompressed files (and subdirectories).
Note | You can uncompress a tar.gz file with a single tar command:
#tar zxvf filename.tar.gz |
To (optionally) view the list of files contained within this Red Hat Package Manager (RPM) file without installing them on your system, type the command:
#rpm -qlp filename.rpm
You can then install the package with the following command:
#rpm -ivh filename.rpm
If you receive an error that a previous version of this package is already installed, you can upgrade to this newer version with the command:
#rpm -Uvh filename.rpm
Note | To view the packages already installed on your system, type:
#rpm -qa Combine this command with the grep command to search for a specific package:
#rpm -qa | grep package-name |
See Appendix D for an in-depth discussion of how to use the rpm program to install packages.