Mounting package demonstration
Let's use rpm to install a package. The only thing you need to do is to add the file name of the package file after the installation command (rpm -i):
# rpm -i eject-1.2-2.i386.rpm
#
Here, the steps mentioned above are executed. The package is now installed. Note that the file name does not have to follow the name habit of the RPM file:
# mv eject-1.2-2.i386.rpm baz.txt
# rpm -i baz.txt
#
In this case, we change the package file name EJECT-1.2-2.i386.rpm to Baz.txt, then install this package. The same as the result of the previous method: Both EJECT-1.2-2 was successfully installed. Regardless of whether or not the package label is included in the file name, the RPM is not used in the installation process. RPM uses the content of the package file, so that even if the package file is saved to the DOS floppy disk, the installation will be successful.
URL ---- Another way to specify the package file name
If you have surfed online, there is no doubt that you noticed the way the web is identified:
http://www.redhat.com/support/docs/rpm/rpm-howto/rpm-howto.html
This is called a URL (Uniform Resource Locator). RPM can also use the URL, which look slightly different. Here is an example of:
FTP: //ftp.redhat.com/pub/redhat/code/rpm/rpm-2.3-1.i386.rpm
Here, ftp: Yes, this URL is a file transfer protocol URL. As shown in the name, this type of URL is used to transfer files. ftp.redhat.com This indicates the name of the host name, or the system with package files.
This URL remaining part (/pub/redhat/code/rpm/rpm-2.3-1.i386.rpm) indicates the path and package file name of the package file.
Therefore, the RPM has the ability to install a package file in the other end of the world, through a simple command:
# rpm -i fpt: //ftp.gnomovision.com/pub/rpms/foobar-1.0-1.i386.rpm
#
This command will use an anonymous FTP to get the FOOBAR version 1.0 package file and install it in your system. Of course, anonymous FTP (no username and password) is not always possible. Therefore, in the URL may have a username and password (in front of the host name):
FTP: // Smith: mypass@ftp.gnomovision.com/pub/rpms/foobar-1.0-1.i386.rpm
However, directly knocking the password will let the people who stare at your screen know your password, this way is not good. So you can try this format:
FTP: //smith@ftp.gnomovision.com/pub/rpms/foobar-1.0-1.i386.rpm
RPM will prompt you to enter your password, then you will give your password:
# rpm -i ftp: // Smith@ftp.gnomovision.com/pub/rpms/foobar-1.0-1.i386.rpm
Password for smith@ftp.gnomovision.com: mypass (not echoed)
#
After taking a correct password, the RPM starts to install this package.
On some systems, the FTP guard program is not running on a standard 21 port. Usually this is to strengthen security. Fortunately, you can specify a port on the URL:
ftp://ftp.gnomovision.com:1024/pub/rpms/foobar-1.0-1.i386.rpm This URL will request a service to port 1024. Another way to specify ports is to use options: - ftpport. This option is discussed later.
You may never have seen a warning message
Based on the environment, the following news may be very few, perhaps often appear. When a package is installed, RPM gives a warning message:
# rpm -i CDP-0.33-100.i386.rpm
Warning: / etc / cdp-config saved as /etc/cdp-config.rpmorig
#
What does it mean? It is related to the management of the Config file with RPM. In this example, RPM found a file (/ etc / cdp-config) on the installation path (/ etc / cdp-config) does not belong to any one that has been installed through the RPM. Since this file is the same name in the CDP-0.33-100 package, there has been a problem.
RPM will solve this problem in the best way. It performs two steps:
1. Rename the original document as CDP-Config.rpmorig.
2. Install new CDP-Config files with package CDP-0.33-100.
Continue our example. If we check the following directory / ETC, we will know exactly what happened:
# ls -al / etc / cdp *
-rw-r - r - 1 root root 119 jun 23
16:00
/ etc / cdp-config
-rw-rw-r - 1 root root 56 Jun 14
21:44
/etc/cdp-config.rpmorig
#
This is a possible best solution to this clever problem. This package will bring this CONFIG file that works normally. After all, this original file may be used by a time-free software. So save it to study it for system administrators. The system administrator will decide whether to continue using this file.