Sunteți pe pagina 1din 19

Package Administration

2/9/2020 1
 Software package administration adds software to
systems and removes software from systems
 Sun and its third-party vendors delivers software
products to users in software packages

2/9/2020 2
 Software packages contain:
 Files that describe the package and the amount of disk
space required for installation
 Compressed software files to be installed on the system
 Optional scripts that run when the package is added or
removed

2/9/2020 3
The “/var/sadm/install/contents” file
 Is a complete record of all the software packages
installed on the local system disk
 It references ever file and directory belonging to every
software package and shows the configuration of each
product installed
 “# more /var/sadm/install/contents”

2/9/2020 4
 The pkgadd command updates the file each time
new packages are installed
 The pkginfo command uses the file to determine
where the required files are located on the system
 To determine if a particular file was installed on
the system disk and to find the directory in which
it is located
 “#grep showrev /var/sadm/install/contents”

2/9/2020 5
Administering Packages from the Command
line
 pkgadd - installs software packages to the system
 pkgrm - removes a package from the system
 pkginfo - displays software package information
 pkgchk - checks package installation state

2/9/2020 6
Displaying information about installed
Software Packages
 The “pkginfo” command is used to display information
about the software packages installed on the local
system
 The “/var/sadm/pkg” directory maintains a record of
all installed packages

2/9/2020 7
 To display information about the software packages
installed on a local system
 “# pkginfo | more”
 To view additional information
 “# pkginfo -l | more”
 To display information for a specific package
 “# pkginfo -l SUNWman”
 To determine how many packages are installed on
disk
 “# pkginfo | wc -l”
2/9/2020 8
 To view information about packages that are located on
Solaris 9 Software 1 of 2 CD-ROM
 “# pkginfo -d /cdrom/cdrom0/s0/Solaris_9/Product | more”

 To view information about packages that are located on


Solaris 9 Software 2 of 2 CD-ROM
 “# pkginfo -d /cdrom/cdrom0/Solaris_9/Product | more”

2/9/2020 9
Adding a Software Package
 To install “SUNWns6m” package from a CD-ROM
 “# cd
/cdrom/cdrom0/Solaris_9/ExtraValue/EarlyAccess/Netsca
pe_6/Packages”
 “# pkgadd -d . SUNWns6m”

2/9/2020 10
Checking a Package Installation
 To check the contents and attributes of a package
 “# pkgchk SUNWcarx”
 To list the files contained in a package
 “# pkgchk -v SUNWcarx”

2/9/2020 11
 To determine if the contents and attributes of a file
have changed since it was installed
 “# pkgchk -p /etc/shadow”
 To list information about a selected file
 “# pkgchk -l -p /usr/bin/showrev” (full path should be
typed)

2/9/2020 12
Removing a Software Package
 To remove a software package from the system
 “#pkgrm SUNWapchr”

2/9/2020 13
Adding Packages by using a Spool Directory
 For convenience, copy frequently installed software
packages from the CD to a spool directory on the
system
 Default spool directory is “/var/spool/pkg”

2/9/2020 14
 To copy a package into the /var/spool/pkg
directory
 “# pkgadd -d /cdrom/cdrom0/s0/Solaris_9/Product -s
spool SUNWensqr.u
 To copy a package to the “/export/pkg” directory
 “# pkgadd -d /cdrom/cdrom0/s0/Solaris_9/Product -s
/export/pkg SUNWensqr.u

2/9/2020 15
 To remove a package from default spool directory
 “# pkgrm -s spool SUNWensqr.u”
 To remove a package from /export/pkg directory
 “# pkgrm -s /export/pkg SUNWensqr.u”

2/9/2020 16
Package Administration Files and Directories
 /var/sadm/install/contents - A Software Package map
of the entire system
 /opt/pkgname - The preferred location for the
installation of unbundled packages

2/9/2020 17
 /opt/pkgname/bin or /opt/bin - The preferred
location for the executable files of unbundled
packages
 /var/opt/pkgname or /etc/opt/pkgname - The
preferred location for log files of unbundled packages

2/9/2020 18
Package Administration Commands
 pkginfo - Lists packages installed on the system or
available on distribution media
 pkgadd - Installs packages
 pkgrm - Removes packages
 pkgchk - Verifies the attributes of the path names that
belong to packages

2/9/2020 19

S-ar putea să vă placă și