📄 ch52_05.htm
字号:
></LI><LICLASS="listitem"><PCLASS="para">SCO UNIX 3.2.4</P></LI></UL><PCLASS="para">The pre-compiled binaries may work on operating systemversions slightly older or newer than the ones listed here.Some programs take advantage of features thatare not supported on all the platforms.The install program will tellyou if a program is not available for your platform.</P><PCLASS="para">If you are uncertain of your operating systemversion, the <EMCLASS="emphasis">uname</EM> command may help:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>uname -a</B></CODE>SunOS ruby 4.1.4 1 sun4m</PRE></BLOCKQUOTE></P><PCLASS="para">If your platform is not listed, you should try building theprograms from source code as described in article<ACLASS="xref"HREF="ch52_08.htm"TITLE="Building Programs from Source Code ">52.8</A>.</P><DIVCLASS="sect3"><H4CLASS="sect3"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.3.1">52.5.3.1 Directory Structure </A></H4><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62805"></A><ACLASS="indexterm"NAME="AUTOID-62807"></A>There is a standard installation structure for all packages on the CD-ROM.Using this structure (and some simple variations of it), you can tailor how and where your packages will be installed on your system.</P><PCLASS="para">The basic directory structure is shown in <ACLASS="xref"HREF="ch52_05.htm#UPT-ART-9503-FIG-0"TITLE="Basic Directory Structure">Figure 52.1</A>.</P><H4CLASS="figure"><ACLASS="title"NAME="UPT-ART-9503-FIG-0">Figure 52.1: Basic Directory Structure</A></H4><IMGCLASS="graphic"SRC="figs/9503a.gif"ALT="Figure 52.1"><PCLASS="para">Some packages may deviate from this structure by having extra directories at the <EMCLASS="emphasis"><install_dir></EM> level.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62818"></A><ACLASS="indexterm"NAME="AUTOID-62820"></A><EMCLASS="emphasis">Shareable</EM> files are those files that are machine independent andcan be shared across many machines in a network using a<SPANCLASS="link">network filesystem (NFS) (<ACLASS="linkend"HREF="ch01_33.htm"TITLE="UNIX Networking and Communications ">1.33</A>)</SPAN>.These are typically text files, such as manual pages or "include files."Sharing files reduces the amount of disk space required by allowing several differentsystems to use the same set of files, as opposed to having to duplicate them foreach machine.It also simplifies administration of the files by having onlya single copy to maintain.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62825"></A><EMCLASS="emphasis">Non-shareable</EM>files are machine/architecture specific and may not be shared (exceptwith other hosts of the same architecture).These are typically binariesor data files that depend on a certain architecture or byte order.</P><PCLASS="para">The installation program gives you the ability to split the shareableand non-shareable files into separate directories.Using this scheme, you couldput shareable files onto a partition or directory that is mounted by multiplemachines.</P><PCLASS="para">If you want to store shareable and non-shareable files at the same directorylevel, the shareable directories will be preceded by a leading <EMCLASS="emphasis">s</EM> to markthem as "shareable."For example, <EMCLASS="emphasis">sbin</EM> is shareable, while <EMCLASS="emphasis">bin</EM> is non-shareable.</P><PCLASS="para">[1]<ACLASS="xref"HREF="ch52_05.htm#UPT-ART-9503-FIG-1"TITLE="Default Installation Directory Structure">Figure 52.2</A>shows how the default installation directories are arranged.</P><BLOCKQUOTECLASS="footnote"><PCLASS="para">[1] You may also remove the leading <EMCLASS="emphasis">s</EM> from the shareable directories <EMCLASS="emphasis">sinclude</EM>, <EMCLASS="emphasis">sspool</EM>, <EMCLASS="emphasis">sbin</EM>, and <EMCLASS="emphasis">slib</EM>.This way, youcan merge <EMCLASS="emphasis">slib</EM> into <EMCLASS="emphasis">lib</EM>, and <EMCLASS="emphasis">sbin</EM> into <EMCLASS="emphasis">bin</EM> if your shareable and non-shareable files are stored in the same directory, ormake names clearer if your shareable and non-shareable filesare not stored together.</P></BLOCKQUOTE><H4CLASS="figure"><ACLASS="title"NAME="UPT-ART-9503-FIG-1">Figure 52.2: Default Installation Directory Structure</A></H4><IMGCLASS="graphic"SRC="figs/9503b.gif"ALT="Figure 52.2"><PCLASS="para">You can modify this structure using the Smart Installation Systemand any necessary directories will be created(if you have permission to do so).</P><PCLASS="para">In order to run the software after installation, you will need to make sure that your shell path variable includes <EMCLASS="emphasis"><install_dir>/bin</EM> (and possibly <EMCLASS="emphasis"><install_dir>/share/bin</EM>if you choose to use this structure).For example, if <EMCLASS="emphasis"><install_dir></EM>is set to <EMCLASS="emphasis">/usr/local</EM>, set your<SPANCLASS="link">search path (<ACLASS="linkend"HREF="ch08_07.htm"TITLE="Setting Your Search Path ">8.7</A>)</SPAN>as appropriate for your shell:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>set path=($path /usr/local/bin /usr/local/share/bin)</B></CODE> <ICLASS="lineannotation">csh</I>$ <CODECLASS="userinput"><B>PATH=$PATH:/usr/local/bin:/usr/local/share/bin ; export PATH</B></CODE> <ICLASS="lineannotation">sh</I></PRE></BLOCKQUOTE></P><PCLASS="para"> The installation software will automatically print out a suggested pathwhen it finishes installing a program.</P></DIV><DIVCLASS="sect3"><H4CLASS="sect3"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.3.2">52.5.3.2 Starting the Installation </A></H4><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62866"></A>To begin the installation process, become the superuser and mount the CD-ROM.For example, on a Sun running SunOS 4.1.4:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>su</B></CODE>Password:# <CODECLASS="userinput"><B>/etc/mount -r -t hsfs /dev/sr0 /cdrom</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">Then change directories to the mount point you specified for the CD-ROM and see what is there.In our case, we specified<EMCLASS="emphasis">/cdrom</EM> as our mount point:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"># <CODECLASS="userinput"><B>cd /cdrom</B></CODE># lscommon install.pt alpha linuxhp700 instinfo rs6000 sun4ci386 readme sources ssol2</PRE></BLOCKQUOTE></P><PCLASS="para">The output could look slightly different depending on the type of system:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">ALPHA/ CONFIG1 HP700/ INSTINFO/ RS6000/ SUN4C/BUILD.PT* CONFIG2.REV I386/ LINUX/ SOURCES/COMMON/ CONFIG3.Z INSTALL.PT* README SSOL2/</PRE></BLOCKQUOTE></P><PCLASS="para">One of the first things that the installation program will do when installingsoftware is to copy the programs into a "staging" area.By default, this isthe directory <EMCLASS="emphasis">/tmp</EM>.By setting the environment variable <EMCLASS="emphasis">TMPDIR</EM> toanother directory, you can alter this location.</P><PCLASS="para">For example, if you want to use the directory <EMCLASS="emphasis">/mondo</EM> for the stagingarea:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>setenv TMPDIR /mondo</B></CODE> <ICLASS="lineannotation">csh</I>$ <CODECLASS="userinput"><B>TMPDIR=/mondo; export TMPDIR</B></CODE> <ICLASS="lineannotation">sh</I></PRE></BLOCKQUOTE></P><BLOCKQUOTECLASS="note"><PCLASS="para"><STRONG>NOTE:</STRONG> If you wish to install software in "system" areas, you will likely run intoproblems with file permissions.You can just become the superuser and notworry about permissions, but this is dangerous because you could overwritepreviously installed or vendor-supplied software.The other option is torun the install as an unprivileged user.This should prevent you fromdamaging system areas, but you will have to use<SPANCLASS="link"><EMCLASS="emphasis">chmod</EM> (<ACLASS="linkend"HREF="ch22_07.htm"TITLE="Using chmod to Change File Permission ">22.7</A>)</SPAN>to make directories writablebefore you begin the installation process - or possiblyuse<SPANCLASS="link">group permissions (<ACLASS="linkend"HREF="ch22_13.htm"TITLE="Groups and Group Ownership ">22.13</A>)</SPAN>to control access.</P></BLOCKQUOTE></DIV><DIVCLASS="sect3"><H4CLASS="sect3"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.3.3">52.5.3.3 Running Install </A></H4><PCLASS="para">Once you have the CD-ROM properly mounted, run the appropriate install command for your system.For example:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>./install.pt</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">or:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>./INSTALL.PT\;1</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">The installation program will display menus and prompt you for input fromnow on.It will also try to guess the type of machine you are running iton and the mount point of the CD-ROM:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">Assuming CDROM is mounted at /archive/cdromAssuming MACHINE is ALPHA Welcome to Ready-to-Run Software's * Smart Installation System *This installation system requires write permission in /tmp (or $TMPDIR ifit's set) directory (for staging the install) and write permission in theinstallation directory for the actual install (these may be the same). ...</PRE></BLOCKQUOTE></P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62911"></A>At this point, the installation program may ask if you want to use adifferent<SPANCLASS="link"><EMCLASS="emphasis">umask</EM> (<ACLASS="linkend"HREF="ch22_04.htm"TITLE="Setting an Exact umask ">22.4</A>)</SPAN>value for the installation process: </P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">Use umask of 022 instead of 007 for install [y]? y</PRE></BLOCKQUOTE></P><PCLASS="para">This will affect the permissions of the software when it isinstalled. The suggested value of 022 will allow anyone to execute orread the programs, but gives write permission only to you.</P><PCLASS="para">The install program will then present a list of the availablesoftware:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">The PowerTools2 package contains the following scripts:! 80cols Clear _emacs_ml _enter_csh _enter_sh _exit_csh _exit_sh addup age_files ascii awf behead bkedit cal_today catsaway center cgrep ...The PowerTools2 package contains the following packages:bash bitmaps bsdtar bsplit calen cpmodcvtbase delete diff ediff emacs fgrepfileutils find gawk getopt glimpse grabchars ...</PRE></BLOCKQUOTE></P><PCLASS="para">After the names of the software packages have been displayed, you areprompted for which ones to install:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">Enter the name of a package to install or choose Search, Quit or All<package>, S(earch), A(ll), Q(uit) [Search]?</PRE></BLOCKQUOTE></P><PCLASS="para">You can now type the name of the package, search for packages, quit theinstallation program, or install all packages in one fell swoop.</P></DIV><DIVCLASS="sect3"><H4CLASS="sect3"><ACLASS="title"NAME="UPT-ART-9503-SECT-1.3.4">52.5.3.4 Installing a Single Program </A></H4><PCLASS="para"><ACLASS="indexterm"NAME="UPT-ART-9503-IX-INSTALLATION-PROCESS-FOR-SINGLE-PROGRAM-SINGLE"></A>Some of you might prefer not to install the entire distribution, but just selected programs. </P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-62932"></A>For this example, let's assume you are looking for programs that do somethingwith terminals, but you don't know what they are called.You can use the"Search" function at the main menu to look for you.Just press RETURN at the prompt, as the "Search" is thedefault action in the square brackets (<CODECLASS="literal">[]</CODE>).</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen"><package>, S(earch), A(ll), Q(uit) [Search]? s</PRE></BLOCKQUOTE></P><PCLASS="para">Then type in "terminal" for the search keyword:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">Search package descriptions for (? for help) []? terminal</PRE></BLOCKQUOTE></P><PCLASS="para">All packages matching this description will be displayed:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">The descriptions for the following packages mention "terminal": 1. Clear 2. emacs 3. qterm 4. screen 5. tcap 6. termtest 7. tputinit A. ALL N. NONEChoose one please:</PRE></BLOCKQUOTE></P><PCLASS="para">For this example, the <EMCLASS="emphasis">qterm</EM> program is selected, which is option 1:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">Choose one please: 3</PRE></BLOCKQUOTE></P><PCLASS="para">A description of the program is now displayed:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">qterm - version 5.0 Version 5.0Qterm is a program that queries terminals to find out what kind ofterminal is responding. It is useful to automagically define yourterminal type. It prints the name of the terminal (compatible,hopefully, with a termcap/terminfo name) such as "vt100" to standardoutput.The qterm package is approximately 64Kb 32Kb - Required 15Kb - Shared: Formatted Man pages 3Kb - Shared: Other Shareable files 13Kb - Shared: Unformatted Man pagesInstall qterm [y]?qterm was compiled and made "Ready-to-Run" by Ready-to-Run Software, Inc. Copyright (c) 1990 Michael A. Cooper. This software may be freely distributed provided it is not sold for profit and the author is credited appropriately.Power Tools distribution by permission of the author. ************************</PRE></BLOCKQUOTE></P><PCLASS="para">After information about <EMCLASS="emphasis">qterm</EM> is printed, you are told how muchspace it will require and then asked whether you want it installed.Press RETURN to install it, or "n" for "no" (followed byRETURN) if you don't want it installed. For our example, wewant <EMCLASS="emphasis">qterm</EM> installed, so we just press RETURN.</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">The qterm package is approximately 56Kb 24Kb - Required 15Kb - Shared: Formatted Man pages 3Kb - Shared: Other Shareable files 13Kb - Shared: Unformatted Man pagesInstall qterm [y]? <KBDCLASS="keycap">[RETURN]</KBD></PRE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -