⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0033-0035.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:




<HTML>

<HEAD>

<TITLE>Maximum RPM (RPM):Using RPM to Install Packages:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311054 //-->

<!-- TITLE=Maximum RPM (RPM)//-->

<!-- AUTHOR=Edward Bailey//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=02 //-->

<!-- PAGES=0017-0036 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0030-0032.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0036-0036.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-33"><P>Page 33</P></A>







<P>during the development of their packages. By preventing the pre- and postinstall scripts

from running, a package builder can keep a buggy package from bringing down his

development system. Once the bugs are found and eliminated, the

--noscripts option is no longer necessary.

</P>



<H4><A NAME="ch02_ 20">

2.4.11. --percent: Not Meant for Human Consumption

</A></H4>



<P>An option that will probably never be very popular is

--percent. This option is meant to be used by programs that interact

with the user, perhaps presenting a graphical user interface

for RPM. When the --percent option is used, RPM displays a series of numbers. Each number

is a percentage that indicates how far along the install is. When the number reaches 100%,

the install is complete. Here's an example:

</P>



<!-- CODE //-->

<PRE>

# rpm -i --percent iBCS-1.2-3.i386.rpm

%f iBCS:1.2:3

%% 0.002140

%% 1.492386

%% 5.296632

%% 9.310026

%% 15.271010

%% 26.217846

%% 31.216000

%% 100.000000

%% 100.000000

#

</PRE>

<!-- END CODE //-->



<P>The list of percentages will vary depending on the number of files in the package, but

every package ends at 100% when completely installed.

</P>



<H4><A NAME="ch02_ 21">

2.4.12. --rcfile &lt;rcfile&gt;: Use

&lt;rcfile&gt; As an Alternate<BR>

rpmrc File

</A></H4>



<P>The --rcfile option is used to specify a file containing default settings for RPM.

Normally, this option is not needed. By default, RPM uses

/etc/rpmrc and a file named .rpmrc located in your login directory.

</P>



<P>This option would be used if there were a need to switch between several sets of RPM

defaults. Software developers and package builders will normally be the only people using the

--rcfile option. For more information on rpmrc files, see Appendix B.

</P>



<H4><A NAME="ch02_ 22">

2.4.13. --root &lt;path&gt;: Use &lt;path&gt; As an Alternate Root

</A></H4>



<P>Adding --root &lt;path&gt; to an install

command forces RPM to assume that the directory

specified by &lt;path&gt; is actually the root directory. The

--root option affects every aspect of the install process, so pre- and postinstall scripts are run with

&lt;path&gt; as their root directory (using

chroot(2). In addition, RPM expects its database to reside in the directory specified by

the dbpath rpmrc file entry, relative to

&lt;path&gt;. (For more information on rpmrc file entries,

see Appendix B.)

</P>



<A NAME="PAGENUM-34"><P>Page 34</P></A>



<P>Normally, this option is used only during an initial system install or when a system has been booted off a rescue disk and some packages need to be reinstalled.

</P>



<H4><A NAME="ch02_ 23">

2.4.14. --dbpath &lt;path&gt;: Use &lt;path&gt; to Find an RPM Database

</A></H4>



<P>In order for RPM to do its handiwork, it needs access to an RPM database. Normally, this database exists in the directory specified by the

rpmrc file entry dbpath. By default, dbpath is set to

/var/lib/rpm.

</P>



<P>Although the dbpath entry can be modified in the appropriate

rpmrc file, the --dbpath option is probably a better choice when the database path needs to be changed temporarily. An

example of a time the --dbpath option would come in handy is when it's necessary to examine an RPM database copied from another system. Granted, it's not a common occurrence, but it's difficult to handle any other way.

</P>



<H4><A NAME="ch02_ 24">

2.4.15. --ftpport &lt;port&gt;: Use &lt;port&gt; in FTP-Based Installs

</A></H4>



<P>Back in section 2.2.1 you saw how RPM can access package files with the use of a URL.

You also learned that some systems may not use the standard FTP port. In those cases, it's

necessary to give RPM the proper port number to use. As mentioned earlier, one approach is to

embed the port number in the URL itself.

</P>



<P>Another approach is to use the --ftpport option. RPM will access the desired port when

this option, along with the port number, is added to the command line. In cases where the

desired port seldom changes, it may be entered in an

rpmrc file by using the ftpport entry. For more information on the use of rpmrc files, see Appendix B.

</P>



<H4><A NAME="ch02_ 25">

2.4.16. --ftpproxy &lt;host&gt;: Use &lt;host&gt; As a Proxy in<BR>

FTP-Based Installs

</A></H4>



<P>Many companies and Internet service providers (ISPs) employ various

methods to protect their network connections against misuse. One

of these methods is to use a system that will

process all FTP requests on behalf of the other systems on the company or ISP network. Having a

single computer act as a proxy for the other systems serves to protect the other systems against

any FTP-related misuse.

</P>



<P>When RPM is employed on a network with an FTP proxy system, it will be necessary for

RPM to direct all its FTP requests to the FTP proxy. RPM will

send its FTP requests to the specified proxy system when

the --ftpproxy option, along with the proxy hostname, is added to

the command line.

</P>



<P>In cases where the proxy host seldom changes, you can enter it in an

rpmrc file by using the ftpproxy entry.

</P>



<A NAME="PAGENUM-35"><P>Page 35</P></A>





<H4><A NAME="ch02_ 26">

2.4.17. --ignorearch: Do Not Verify Package Architecture

</A></H4>



<P>When a package file is created, RPM specifies the architecture, or type of computer hardware, for which the package was created. This is a good

thing because the architecture is one of the main factors in determining whether a package written for one computer is going to be

compatible with another computer.

</P>



<P>When a package is installed, RPM uses the arch_compat

rpmrc entries to determine what are normally considered compatible architectures. Unless you're porting RPM to a new

architecture, you shouldn't make any changes to these entries. (You'll find more on arch_compat in section 19.3.1 in Chapter 19, &quot;Building Packages for Multiple Architectures and

Operating Systems.&quot;) Although RPM attempts to make the right decisions regarding package

compatibility, there are times when it errs on the side of conservatism. In those cases, it's necessary

to override RPM's decision. The --ignorearch option is used in those cases. When it's added

to the command line, RPM will not perform any architecture-related checking.

</P>

<BR>

<P>



<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

CAUTION

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

Unless you really know what you're doing, you should never use

--ignorearch!

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

</P>

<H4><A NAME="ch02_ 27">

2.4.18. --ignoreos: Do Not Verify the Package Operating System

</A></H4>



<P>When a package file is created, RPM specifies the operating system for which the package

was created. This is good because the operating system is one of the main factors in determining whether a package written for one computer is going to be compatible with another computer.

</P>



<P>When a package is installed, RPM uses the os_compat

rpmrc entries to determine what are normally considered compatible operating systems. Unless you're porting RPM to a new

operating system, you shouldn't make any changes to these entries. (You'll find more on

oscompat in section 19.3.1 in Chapter 19.) Although RPM

attempts to make the right decisions regarding package compatibility,

there are times when it errs on the side of conservatism. In

those cases, it's necessary to override RPM's decision. The

--ignoreos option is used in those cases. When it's added to the command line, RPM will not perform any operating

system_related checking.

</P>

<BR>

<P>



<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

CAUTION

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

Unless you really know what you're doing, you should never use

--ignoreos!

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

</P>

<P><CENTER>

<a href="0030-0032.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0036-0036.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -