Maximum RPM: Taking the RPM Package Manager to the Limit
Chapter 2. Using RPM to Install Packages
Let's have RPM install a package. The only thing necessary is to give the command (rpm -i) followed by the name of the package file:
|
At this point, all the steps outlined above have been performed. The package is now installed. Note that the file name need not adhere to RPM's file naming convention:
|
In this case, we changed the name of the package file
eject-1.2-2.i386.rpm
to baz.txt
and then proceeded to install the
package. The result is identical to the previous install, that is, the
eject-1.2-2
package successfully installed. The name of the package
file, although normally incorporating the package label, is not used by
RPM during the installation process. RPM uses the contents of the
package file, which means that even if the file was placed on a DOS
floppy and the name truncated, the installation would still proceed
normally.
If you've surfed the World Wide Web, you've no doubt noticed the way web pages are identified:
|
This is called a Uniform Resource Locator, or URL. RPM can also use URLs, although they look a little bit different. Here's one:
|
The ftp: signifies that this URL is a File Transfer Protocol URL. As the
name implies, this type of URL is used to move files around. The section
containing ftp.redhat.com
specifies the hostname, or the name of the
system where the package file resides.
The remainder of the URL (/pub/redhat/code/rpm/rpm-2.3-1.i386.rpm
)
specifies the path to the package file, followed by the package file
itself.
RPM's use of URLs gives us the ability to install a package located on the other side of the world, with a single command:
|
This command would use anonymous FTP to obtain the foobar
version 1.0
package file and install it on your system. Of course, anonymous FTP (no
username and password required) is not always available. Therefore, the
URL may also contain a username and password preceding the hostname:
|
However, entering a password where it can be seen by anyone looking at your screen is a bad idea. So try this format:
|
RPM will prompt you for your password, and you'll be in business:
|
After entering a valid password, RPM installs the package.
On some systems, the FTP daemon doesn't run on the standard port 21. Normally this is done for the sake of enhanced security. Fortunately, there is a way to specify a non-standard port in a URL:
|
This URL will direct the FTP request to port 1024. The --ftpport
option is another way to specify the port. This option is discussed
later, in the Section called --ftpport <port>
: Use <port>
In FTP-based
Installs.
Depending on circumstances, the following message might be rare or very common. While performing an ordinary install, RPM prints a warning message:
|
What does it mean? It has to do with RPM's handling of config files. In
the example above, RPM found a file (/etc/cdp-config
) that didn't
belong to any RPM-installed package. Since the cdp-0.33-100
package
contains a file of the same name that is to be installed in the same
directory, there is a problem.
RPM solves this the best way it can. It performs two steps:
-
It renames the original file to
cdp-config.rpmorig
. -
It installs the new
cdp-config
file that came with the package.
Continuing our example, if we look in /etc
, we see that this is
exactly what has happened:
|
This is the best possible solution to a tricky problem. The package is installed with a config file that is known to work. After all, the original file may be for an older, incompatible version of the software. However, the original file is saved so that it can be studied by the system administrator, who can decide whether the original file should be put back into service or not.