UNIX System Administration A Beginner’s Guide PHẦN 3 pdf

70 270 0
UNIX System Administration A Beginner’s Guide PHẦN 3 pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

120 UNIX System Administration: A Beginner’s Guide system SUNWadmc System administration core libraries system SUNWadmfw System & Network Administration Framework system SUNWadmj Admin/Install Java Extension Libraries More When invoked, it shows all the available Solaris packages installed, sorted by the classification of package types. The output of this command is sent to the more command, which permits the user to peruse the output one screen full at a time. Hitting the SPACEBAR on the keyboard displays another screen of text. When packages are created, they contain a primary category parameter, which denotes the classification of application the software represents. The most common categories are system, application, and utility. For example, as you can see from the preceding output, the Netscape package falls under the application package calls, which makes complete sense given that Netscape is a Web browser application. A quick scan of the available packages installed on a generic system reveals that both system and application are the most widely installed types of software. The pkginfo tool (as well as the other tools) supports several important and common command line options as shown in Table 4-2. Command Definition -a Display the architecture of the package. -c Display all packages that match the specified category. -d Defines the device, directory name, or individual package name to query for package information. -i Display information on complete installed packages. -l Display additional package information in a long format. -p Display information on only partially installed packages. -q Used by an external program to determine if a package is installed. Doesn’t show any output. -r Display the installation directory base for any packages that have been relocated. -R Defines the directory to be used as the root path for packages. -v Display packages with the specified version information. -x Display extract listing information from a package. Table 4-2 pkginfo Command-Line Options TEAMFLY Team-Fly ® 444 One of the most important is the –d option, which tells the program where to look to determine information about one or more packages. This option is used to specify the hardware device, which contains the packages (that is, CD-ROMs) or other media. However, it can also be used when a single package is specified, or even a directory name. For example, let’s assume we would like to examine the contents of the Solaris 8 Companion CD-ROM, which contains useful tools and utilities. In general, we need to specify the directory where the packages are located. The command # pkginfo -d /cdrom/s8_software_companion/components/i386/Package shows all the packages available under the /cdrom/s8_software_companion/ components/i386/Package directory. The following output shows a partial list of the available packages: system SFWaalib aalib - ASCII Art Library system SFWaconf autoconf - GNU autoconf system SFWamake automake - GNU automake system SFWasclk asclock - the AfterStep clock system SFWastep afterstep - X11 window manager system SFWaufl audiofile - audio library system SFWbdb Berkeley DB - database library system SFWbison GNU bison - a better yacc system SFWcdrec cdrecord - record audio or data Compact Discs system SFWcvs cvs - version control system system SFWddd DDD - GNU Data Display Debugger system SFWdiffu diffutils - GNU diffutils system SFWemacs GNU Emacs - Editor system SFWenscr GNU enscript - convert text files to PostScript system SFWesd esound - The Enlightened Sound Daemon system SFWethrl Ethereal - Interactively browse network traffic system SFWexpct expect - programmed dialogue with programs system SFWfile file - determine file type system SFWflex GNU flex - a lex replacement system SFWfnlib fnlib - X11 font rendering library system SFWftype Freetype - Free TrueType Rendering Engine system SFWfvwm fvwm - X11 virtual window manager system SFWgawk gawk - pattern scanning and processing language system SFWgbin binutils - GNU binary utilities system SFWgcal gcal - the GNU Gregorian calendar program system SFWgcc gcc - GNU Compiler Collection system SFWgcmn gcmn - Common GNU package Module 4: Software Package Management Tools 121 4 122 UNIX System Administration: A Beginner’s Guide system SFWgdb gdb - GNU source-level debugger system SFWgfile fileutils - GNU file management utilities system SFWgfind findutils - GNU find utilities system SFWgimp gimp - GNU Image Manipulation Program system SFWglib GLIB - Library of useful routines for C programming system SFWgm4 GNU m4 - macro processor system SFWgmake gmake - GNU make system SFWgnome Gnome - X11 Windowing Environment system SFWgplot gnuplot - The Gnuplot Plotting Utility system SFWgrep grep - GNU grep utilities system SFWgroff GNU groff - document formatting system system SFWgs GNU Ghostscript - postscript interpreter system SFWgsfot GNU Ghostscript Fonts - Other Fonts system SFWgsfst GNU Ghostscript Fonts - Standard Fonts system SFWgtar gtar - GNU tar We can also obtain information on individual packages on the command line. Thus, # pkginfo -d /cdrom/s8_software_companion/components/i386/Packages SFWtop system SFWtop top - display information about processes In this case, we specified the top (SFTop) system-monitoring package, which provides additional information about the package. To learn even more about a particular package, the –l option, which displays a long listing, can be used: # pkginfo -l -d /cdrom/s8_software_companion/components/i386/Packages SFWtop PKGINST: SFWtop NAME: top - display information about processes CATEGORY: system ARCH: i386 VERSION: 3.5_12,REV=2001.02.19.04.12 BASEDIR: /opt VENDOR: ftp://ftp.groupsys.com/pub/top DESC: top - display and update information about the top cpu processes PSTAMP: freeware20010219074803 HOTLINE: Please contact the owners of this software STATUS: spooled FILES: 10 spooled pathnames 4 directories 1 executables 4 package information files 99 blocks used (approx) 2425 blocks used (approx) Directory where package will be installed Module 4: Software Package Management Tools 123 4 The output displayed shows much more information about the package, and includes information about where the package will be installed, the size of the package, and other important details. 1-Minute Drill ● Why is the more command useful in conjunction with pkginfo? pkgadd When it is necessary to install a new package or upgrade an existing one, the pkgadd command can be used. This tool uses the same command-line arguments as pkginfo. For example, to install a single package that is specified on the command line, we could use the following command: # pkgadd -d /cdrom/s8_software_companion/components/i386/Packages SFWtop Processing package instance <SFWtop> from </cdrom/s8_software_companion/components/ i386/Packages> top - display information about processes (i386) 3.5_12,REV=2001.02.19.04.12 Top users/processes display for Unix Version 3 This program may be freely redistributed, but this entire comment MUST remain intact. Copyright (c) 1984, 1989, William LeFebvre, Rice University Copyright (c) 1989 - 1994, William LeFebvre, Northwestern University Copyright (c) 1994, 1995, William LeFebvre, Argonne National Laboratory Copyright (c) 1996, William LeFebvre, Group sys Consulting DISCLAIMER "top" is distributed free of charge. It should not be considered an official product of Group sys Consulting. William LeFebvre supports "top" in his spare time and as time permits. NO WARRANTY: BECAUSE "top" IS DISTRIBUTED FREE OF CHARGE, THERE IS ABSOLUTELY NO WARRANTY PROVIDED, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, GROUP SYS CONSULTING, ARGONNE NATIONAL LABORATORY, NORTHWESTERN UNIVERSITY, WILLIAM N. LeFEBVRE AND/OR OTHER PARTIES PROVIDE "top" "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE "top" PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ● If you have a lot of packages installed on your system, piping the results of pkginfo to more makes it easier to read them by displaying them one screen at a time. Package name to install IN NO EVENT WILL GROUP SYS CONSULTING, ARGONNE NATIONAL LABORATORY, NORTHWESTERN UNIVERSITY, WILLIAM N. LeFEBVRE, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE "top", BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH OTHER PROGRAMS) THE PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. So there! YOU MUST OBSERVE ANY AUTHORS' CONDITIONS WITH RESPECT TO INDIVIDUAL COMPONENTS PROVIDED WITHIN THIS CODE. SUPPORT FOR THE TECHNOLOGIES AND DOCUMENTATION IS NOT PROVIDED BY SUN MICROSYSTEMS, INC. THE TECHNOLOGIES AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT TECHNICAL SUPPORT OR WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Using </opt> as the package base directory. ## Processing package information. ## Processing system information. ## Verifying package dependencies. ## Verifying disk space requirements. ## Checking for conflicts with packages already installed. ## Checking for setuid/setgid programs. This package contains scripts which will be executed with super-user permission during the process of installing this package. Do you want to continue with the installation of <SFWtop> [y,n,?] y Installing top - display information about processes as <SFWtop> ## Installing part 1 of 1. Installation of <SFWtop> was successful. The above command installs the top utility on a Solaris system, and as you can see, a fair amount of output was generated showing all the steps involved with the installation process. Note that the Solaris package tools are sophisticated enough to prompt the user should it be necessary to query for additional information. This is one of the most powerful features of these tools—to install software components in an intelligent manner regardless of the target platform. pkgrm In order to remove one or more packages, use the pkgrm command. The basic syntax of this command requires the name of the package that should be removed. For example, to remove the FTP client application, SMCxftp, issue the following command: # pkgrm SMCxftp 124 UNIX System Administration: A Beginner’s Guide Installer prompt waiting for your input before continuing. Installer message informing you where the package is being installed. 4 The resulting output is shown: The following package is currently installed: SMCxftp xftp (sparc) 2.1 Do you want to remove this package? yes ## Removing installed package instance <SMCxftp> ## Verifying package dependencies. ## Processing package information. ## Removing pathnames in class <none> /usr/local/man/man1/xftp.1 /usr/local/man/man1 <shared pathname not removed> /usr/local/man <shared pathname not removed> /usr/local/lib/XFtp.ad /usr/local/lib /usr/local/doc/xftp/README /usr/local/doc/xftp/NEW_FEATURES /usr/local/doc/xftp/CHANGES /usr/local/doc/xftp/BUGS /usr/local/doc/xftp /usr/local/doc /usr/local/bin/xftp /usr/local/bin <shared pathname not removed> ## Updating system information. Removal of <SMCxftp> was successful. As you can see from this output, the pkgrm tool prompts the user to ensure that removal of the specified package is in fact desired. Once done, it also displays all the files that are being removed from the system that are associated with this package. Please note that the pkgrm command must be supplied with the actually package name, not the file that was used to contain the package. For example, # pkgrm xftp pkgrm: ERROR: no package associated with <xftp> doesn’t work and produces an associated error message. If you don’t know the actually package name, use the pkginfo command to find out: # pkginfo -d xftp-2.1-sol8-sparc-local application SMCxftp xftp Note that once a package has been removed from the system, any associated files and/or programs are permanently removed. Module 4: Software Package Management Tools 125 4 Your response to prompt Prompt asking you to confirm removing package 126 UNIX System Administration: A Beginner’s Guide 4.2 Discover HP-UX Package Tools The HP-UX system provides the basic package management tools that include swlist swinstall swremove swlist To display information about the installed product on a HP-UX system, use the swlist package management command. This command has a large number of command line arguments, but the most common ones are listed in Table 4-3. You must have root privileges to execute the HP-UX package commands. The most basic use of the command is to show the currently installed products on a system. The command that you would use is # swlist Option Meaning -a Display a list of products by attribute. -d Display a list of products that are available from a depot, not from the local system. -I Invoke the interactive user interface, which can be used on regular terminals. -l Display a list of objects that correspond to a specific level. This is how to show the detailed components that make up a particular package. -r Display a list of products that are installed on an alternative root file system. -v Display more detailed information regarding products. Table 4-3 Common swlist Command-Line Options Module 4: Software Package Management Tools 127 4 When this command is executed, it displays a list of the currently installed products on the local system. The example output generated includes # Initializing # Contacting target "boston-srv" # Target: boston-srv:/ # Bundle(s): # A4929A B.11.00.11 1000Base-T PCI Gigabit Ethernet Driver A5158A B.11.00.02 HP PCI Tachyon TL Fibre Channel B3701AA C.02.40.000 HP GlancePlus/UX Pak for s800 11.0 B3901BA B.11.01.20 HP C/ANSI C Developer's Bundle for HP-UX 11.00 (S800) B3913DB C.03.25 HP aC++ Compiler (S800) B3919EA_2A5 B.11.00 Special Edition HP-UX Unlimited-User Lic B3929BA B.11.00 HP OnLineJFS (Advanced VxFS) B5456CA C.01.18.01 HP-UX Development Kit for Java* B8342AA B.11.00.03 Netscape Communicator 4.72 B8723AA A.01.02 CIFS/9000 Client Lic. for 9000 Servers B8725AA A.01.02 CIFS/9000 Server Lic. for 9000 Servers HPUXEng64RT B.11.00 English HP-UX 64-bit Runtime Environment OnlineDiag B.11.00.13.16 HPUX 11.0 Support Tools Bundle XSWECO226 A.1.0 Patch Replacement bundle XSWGR1100 B.11.00.49.3 HP-UX General Release Patches, June 2000 XSWHWCR1100 B.11.00.49.3 HP-UX Hardware Enablement and Critical Patches, June 2000 # # Product(s) not contained in a Bundle: # PHCO_21492 1.0 Software Distributor (SD-UX) Cumulative Patch PHKL_22209 1.0 fix f_cred, fork DPFs & accept(2) errors PHNE_22397 1.0 cumulative ARPA Transport patch perl 5.6.0 perl In this example, the system boston-srv was probed with the swlist command, and it shows that a variety of software packages have been installed on the system. The list of packages are broken down into two categories: products contained with a bundle and products that are stand-alone. Products within a bundle simply mean that the package contains a series of files or other objects and the name of the bundle is a container. As you can see from the output, the B8342AA bundle, for instance, corresponds to the Netscape Communicator 4.72 application, while the nonbundle applications include the perl 5.6.0 module. Specifying a package to swlist command, the administrator can drill down and obtain more detailed information about a product or bundle. Thus, the command # swlist A4929A shows the elements of the A4929A package: # Initializing # Contacting target " boston-srv " # # Target: boston-srv:/ # # A4929A B.11.00.11 1000Base-T PCI Gigabit Ethernet Driver # A4929A.GE-DRV B.11.00.11 HP PCI/GSC Gigabit Ethernet Driver A4929A.GE-DRV.GE-KRN B.11.00.11 Gigabit Ethernet Kernel Software Distribution A4929A.GE-DRV.GE-RUN B.11.00.11 Gigabit Ethernet Runtime Software Distribution If we desire even more information and details about this package, we can use the –v option, which provides quite a fair amount of information for each element within the package. The command swlist -v A4929A will produce the following output for the network driver: # Initializing # Contacting target "boston-srv" # # swlist Installed Software Table of Contents # # For host: boston-srv:/ # Date: Mon Dec 31 00:17:38 2001 # # A4929A vendor tag HP uuid title "Hewlett-Packard Company" description "Hewlett-Packard Company " end bundle 128 UNIX System Administration: A Beginner’s Guide HintHint The output below was shortened for brevity since several pages were generated by the above command. 4 tag A4929A software_spec A4929A,r=B.11.00.11,a=HP-UX_B.11.00_32/64,v=HP data_model_revision 2.40 instance_id 1 control_directory A4929A size 1370913 revision B.11.00.11 title 1000Base-T PCI Gigabit Ethernet Driver description "Vendor Name Hewlett-Packard Company This bundle contains the software drivers for the HP 1000Base-SX/T cards A4924A HSC, A4925A HSC EISA, A4926 PCI and A4929A PCI . This is for systems running version 11.** of the HP-UX operating system. The bundle has the Gigabit Ethernet product which contains: Subproduct: Runtime Filesets : GE-KRN, GE-RUN" mod_date Thu Oct 26 14:31:27 PDT 2000 mod_time 972595887 create_date Fri Apr 28 16:45:28 PDT 2000 create_time 956965528 install_date 200010261731.27 architecture HP-UX_B.11.00_32/64 machine_type * os_name HP-UX os_release ?.11.00 os_version * install_source m2403jrw.nsr.hp.com:/var/opt/ignite/depots/Rel_B.11.00/apps_800 is_patch false supersedes category_tag OrderedApps vendor_tag HP directory / qualifier layout_version 1.0 is_locatable true location copyright number contents GE-DRV,r=B.11.00.11,a=HP-UX_B.11.00_32/64,v=HP is_protected false is_reference true associated_bundles hp_ii "factory_integrate=TRUE; title=GELAN; desktop=FALSE" hp_srdo "swtype=I;user=B;bundle_type=C" One extremely useful function of the HP-UX package management tool is that the administrator can query one or more networked remote hosts. It would be great to scan a series of systems from a central system. For example, consider the case where we would like to scan two systems called newyork and chicago. The appropriate swlist command syntax would be swlist @ newyork chicago Module 4: Software Package Management Tools 129 [...]... determine all the installed packages and displays a list as shown here: SD Remove - Software Selection (boston-srv) (1) File View Options Actions Press CTRL-K for keyboard help Target: boston-srv:/ Target Displaying Software: boston-srv:/ 133 Help 134 UNIX System Administration: A Beginner’s Guide Top (Bundles and Products) Marked? 0 of 21 selected Name A4 92 9A A515 8A B3701AA B3901BA B3913DB B3919EA_ 2A5 B3929BA... If you are using a Solaris system: 1 Display all the packages on your system # pkginfo | more 4 138 UNIX System Administration: A Beginner’s Guide 2 Choose a package from the step 1 output and display longer information about it: # pkginfo -l packagename 3 Choose a CD-ROM and display all the packages on it: # pkginfo -d /cdrom/path | more If you are using a HP-UX system: 1 Display all the packages on... its approach to package management For example, when program is started, it automatically scans the system to see if it can find any packages to install Project 4-1 Step-by-Step AM FL Y Let’s imagine that we would like to install a software program called ethereal This tool provides a GUI-based facility to capture a network package The package name is ethereal-0.8.20-sd-11.00.depot 1 Start the swinstall... the system administrator can change it Making this value smaller means that passwords won’t be as tough to forge, while making it larger means that users will have a harder time remembering their passwords This option is system wide; there is currently no way to alter this variable for individual users G A password must have at least one number or special character, plus at least two alphabetic characters... your system # swlist 2 Choose a package from the step 1 output and display longer information about it: # swlist -v packagename 3 Choose a depot and display all the packages on it: # swlist -d @ pathtodepot If you are using a Linux system: 1 Display all the packages on your system a page at a time # rpm query -a | more 2 Choose a package from the step 1 output and display longer information about... the package to install using onscreen menus and prompts rather than specifying all the necessary options on the command line 4 136 UNIX System Administration: A Beginner’s Guide 4 .3 Discover Linux Package Tools The Linux operating system (and most of the other different versions as well) supports the Red Hat Package Manager (RPM) format All the system administrator’s requirements for package management... apply): A Display information about installed packages B Transfer files C Install a new package D Remove an installed package 4 What would this command do: rpm erase XFree86? 5 In Solaris, the command to install the SFWgimp package from the /cdrom/s8_software_companion/components/i386/Package CDROM path is A # pkgadd -d /cdrom/s8_software_companion/components/i386/ Packages SFWgimp B # swinstall -d /cdrom/s8_software_companion/components/i386/... -qv packagename 3 Display more information about the rpm command: #rpm help Module 4: Software Package Management Tools 139 Mastery Check 1 What is the Solaris command to list all the installed packages in the system category? 2 You must have privileges to execute the package information commands discussed in this module 3 The RPM format and rpm utility are used to (choose all that apply): A Display... issues For instance, users can be added to the system using a graphical user interface program, and other tools that operate on the command line can be used as well Despite the fact that perhaps these tools provide overlapping functionality and are meant to address the same problem, they clearly provide a different approach to solving the particular problem Bear in mind also that the administrator isn’t.. .UNIX System Administration: A Beginner’s Guide As a result, two listings are generated for each of the hosts provided on the command line Because of this feature, it is very easy to automate the inventory of installed software across a network of systems swinstall The swinstall utility is used to install or inspect packages that have been installed on the system This tool is fairly sophisticated . 120 UNIX System Administration: A Beginner’s Guide system SUNWadmc System administration core libraries system SUNWadmfw System & Network Administration Framework system SUNWadmj Admin/Install. available packages: system SFWaalib aalib - ASCII Art Library system SFWaconf autoconf - GNU autoconf system SFWamake automake - GNU automake system SFWasclk asclock - the AfterStep clock system. Netscape package falls under the application package calls, which makes complete sense given that Netscape is a Web browser application. A quick scan of the available packages installed on a generic

Ngày đăng: 13/08/2014, 04:21

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan