Pakety: ustanovka dopolnitel'nogo softa
* Kak ustanavlivat' pakety v Solaris 2.5 *
Administrirovanie programmnogo obespecheniya
|tot vopros ochen' vazhen dlya podderzhki i obnovleniya
programmnogo obespecheniya. Dlya etoj celi v OS Solaris
predusmotren special'nyj mehanizm, podderzhivaemyj s pomoshch'yu
utilit "pkgadd" i "pkgrm", sootvetstvenno dobavlyayushchih i
udalyayushchih pakety iz sistemy. CHtoby eti utility mogli
operirovat' s paketami, oni dolzhny byt' predstavleny v
sootvetstvuyushchem vide, ili formate. K sozhaleniyu, daleko ne vse
programmnye produkty dostupny neposredstvenno v formate,
prigodnom dlya "pkgadd". Podavlyayushchee bol'shinstvo produktov dlya
Unix, dostupnyh cherez Internet, nahodyatsya v vide ishodnyh
tekstov, kotorye nado otkompilirovat' i skopirovat' v nuzhnye
mesta. |to imeet mesto, t.k. OS Unix ustanovlena na mashinah s
razlichnymi tipami processorov i razlichnoj arhitekturoj.
Original is here
Glava podgotovlena Sergeem Bogomolovym
Zdes' opisana tol'ko ustanovka paketa dlya sebya (standalone
system), esli vam nuzhno ustanovit' paket v rezhime
server/dataless/diskless - chitajte drugie knizhki (delat' eto nado
tol'ko s bol'shoj toski).
1. Stan'te superpol'zovatelem
2. vvedite:
/usr/sbin/pkgadd -d imya_direktorii_gde_lezhit_paket imya_paketa
naprimer:
/usr/sbin/pkgadd -d /cdrom/solaris_2_5/s0/Solaris_2.5 SUNWpkgA
mozhno ustanovit' neskol'ko paketov srazu (ukazhite ih imena cherez probely).
Imya paketa mozhno uznat' iz instrukcii ili s pomoshch'yu komandy:
/usr/sbin/pkginfo -d imya_direktorii_gde_lezhit_paket
Vnimanie: Solaris ne ochen' horosho otslezhivaet vzaimozavisimost' mezhdu
paketami, tak chto vy sami dolzhny pozabotit'sya o poryadke ustanovki.
Mnogie pakety lyubyat zadavat' vsyakie voprosy vo vremya ustanovki (kuda
vse eto pomestit', ves' li paket ustanovit' i t.d.), tak chto
bud'te gotovy. Naprimer, pri ustanovke toma AnswerBook sprashivaetsya,
chto kopirovat' na zhestkij disk: opisanie ili ves' tom.
Esli vy kopiruete tol'ko opisanie, to ishodnyj CD-ROM dolzhen
byt' ustanovlen kazhdyj raz, kogda vy zapuskaete AnswerBook, inache
nenajdennyj tom budet pomechen kak "nezhivoj" i ego pridetsya
vosstanavlivat'. Kstati, toma razbrosany po 7 diskam!!!
-----------------------------------------------------------------
Proverka ustanovki paketa.
/usr/sbin/pkgchk <imya_paketa>
-----------------------------------------------------------------
Poluchenie informacii o pakete:
/usr/bin/pkginfo -l <imya_paketa>
naprimer:
pkginfo -l SUNWcar
PKGINST: SUNWcar
NAME: Core Architecture, (Root)
CATEGORY: system
ARCH: sparc.sun4m
VERSION: 11.5.1,REV=94.07.15.22.10
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: Core Architecture, (Root)
PSTAMP: fourstar940718191413
INSTDATE: Aug 16 1995 03:39
HOTLINE: Please contact your local service provider
STATUS: completely installed
FILES: 51 installed pathnames
16 shared pathnames
7 directories
29 executables
3794 blocks used (approx)
---------------------------------------------------------------
/usr/sbin/pkgrm <imya_paketa>
---------------------------------------------------------------
Rabota s paketami v graficheskom interfejse
(swmtool dlya 2.4 ili admintool dlya 2.5)
ne nado ustanavlivat' AnswerBook s ih pomoshch'yu.
SWMTOOL
zapusk:
1. stan'te superpol'zovatelem
2. perejdite v graficheskij rezhim, esli vy eshche ne pereshli v nego
3. vvedite:
/usr/sbin/swmtool &
Na ekrane voznikaet novoe okno, programma dolgo-dolgo sobiraet
informaciyu ob uzhe installirovannyh paketah, zatem perehodit v
rezhim ustanovki (rezhim INSTALL/REMOVE pereklyuchaetsya
sootvetstvuyushchimi knopochkami) i, skoree vsego, soobshchaet vam, chto
"ustrojstvo ne gotovo, pomenyajte ustanovki (property)" Delo v
tom, chto swmtool po umolchaniyu schitaet, chto ustanavlivaemyj
paket lezhit na CD-ROM i menedzher tomov vyklyuchen. Esli eto
dejstvitel'no tak, to vstav'te CD-ROM pered zapuskom swmtool.
Inache nazhmite knopku Props... (ustanovki), voznikaet blank, na
stranice (kategorii) Source Media kotorogo vam nado zadat'
ustrojstvo ili direktoriyu, gde lezhit paket.
Naprimer, menyaem Media Type na Mounted Directory, Directory
Name ustanavlivaem v /cdrom/cdrom0 (ustanovka s CD-ROM pri
vklyuchennom menedzhere tomov) i nazhimaem knopku Apply. Esli v
ukazannoj vami direktorii est' pakety, to ih opisaniya budut
perechisleny v glavnom okne swmtool. Dlya kazhdogo paketa
ukazyvaetsya: ikonka (odin yashchik - prostoj paket - na takuyu
ikonku mozhno zhat' dva raza, i poyavlyaetsya podrobnoe opisanie, 3
yashchika - sostavnoj paket - na takuyu ikonku mozhno zhat' dva raza, i
ona raskryvaetsya v spisok vnutrennih paketov - uroven'
vlozhennosti ne ogranichen), opisanie paketa i ego predpolagaemyj
razmer. Vybiraete neobhodimye vam pakety i nazhimaete knopku
Begin Installation (nachat' ustanovku). Dalee ves' dialog
proishodit v a/c rezhime kak pri ustanovke pkgadd. Kstati, blank
ustanovok imeet bol'shoe kolichestvo knopochek, menyushek i pr.:
est' s chem poigrat'sya...
Dlya togo, chtoby udalit' paket, nazhimaete knopku Remove,
vybiraete paket (pakety), kotoryj vy hotite udalit', i
nazhimaete knopku Begin Removal.
Izgotovlenie sobstvennogo paketa
CHtoby legche administrirovat' etot razroznennyj nabor fajlov, poluchayushchijsya
posle kompilyacii, ih mozhno privesti k formatu utility "pkgadd"
samostoyatel'no. Legche vsego etot vopros rassmotret' na konkretnom primere.
Pust' u nas est' paket, sostoyashchij iz 3h programm: "MyProg.bin", "Myprog.lib"
i "MyProg.man", kotorye dolzhny hranit'sya v katalogah "/usr/local/bin",
"/usr/local/lib" i "/usr/local/man" sootvetstvenno. CHtoby sdelat' iz nih
paket, nado prodelat' sleduyushchie prostye shagi:
a) Sozdadim direktoriyu, gde budut hranit'sya ishodnye
dannye dlya utility "pkgmk", kotoraya i delaet sobstvenno paket.
Pust' v nashem primere eto budet direktoriya "~/tmp/MyPackage".
b) Sozdadim pod nim sistemu direktorij, gde dolzhny
raspolagat'sya fajly paketa, i zatem skopiruem eti fajly na svoi
mesta. T.o. v rezul'tate u nas dolzhny poluchit'sya fajly:
~/tmp/MyPackage/bin/MyProg.bin, ~/tmp/MyPackage/lib/MyProg.lib
i ~/tmp/MyPackage/man/MyProg.man
v) Zatem nado sozdat' fajly "pkginfo" i "prototype". Oni
dolzhny vyglyadet' primerno tak (bolee podrobnuyu informaciyu ob
etih fajlah vy mozhete poluchit', nabrav komandy
man -s4 pkginfo
man -s4 prototype
Fajl "prototype":
!PROJDIR=/usr/local
1 i pkginfo=pkginfo
1 d none bin 0755 root other
1 f none bin/MyProg.bin 0644 root other
1 d none lib 0755 poul insects
1 f none lib/MyProg.lib 0644 root other
1 d none man 0755 poul insects
1 f none man/MyProg.man 0644 root other
Fajl "pkginfo":
PKG=MyProg
NAME=MyPackage
ARCH=sparc
VERSION=Version 1.0
CATEGORY=application
VENDOR=Pavel K. Klodin
EMAIL=webmaster@reksoft.ru
PSTAMP=Pstamp
BASEDIR=/usr/local
CLASSES=none
g) Posle togo, kak fajly sdelany, vypolnim sleduyushchie
komandy:
cd ~/tmp/MyPackage
pkgmk -o -d /tmp -r .
Posle etogo v direktorii "/tmp" budet sozdan paket "MyPackage" v vide
struktury fajlov i direktorij. S nim uzhe mozhno operirovat' utilitoj
"pkgadd". d) Teper', nakonec, vypolnim komandy (predvaritel'no stav
superpol'zovatelem s pomoshch'yu komandy "su -"):
cd /tmp
pkgadd -d .
PRIMECHANIE: Sleduet pomnit', chto pakety mogut byt'
predstavleny v dvuh ravnopravnyh formah:
v vide struktury direktorij (kak uzhe bylo rassmotreno vyshe);
v vide tak nazyvaemyh "potokovyh paketov" (stream packages).
Oni predstavlyayut soboj prostoj fajl, kak esli by byli
zapisany na strimmernoj kassete ili kakom-libo drugom
posledovatel'nom ustrojstve (otsyuda, vozmozhno, i nazvanie).
Obrashchat'sya s nimi sleduet tak zhe, kak i s "obychnymi" paketami v
vide struktury direktorij i fajlov. |ti 2 formy vzaimno
preobrazuyutsya komandoj "pkgtrans".
Sovetom podelilsya Pavel Klodin
pkginfo {pkg} - test for presents of package.
pkgadd -d /cdrom/Solaris_2.3 <pkg ...>
- add missing packages
pkgrm {pkg ...} - remove packages.
pkgchk -q {pkg} - test for existance of package
pkgchk {options} [pkg] - check installed packages for
integrity.
Let's say your Solaris2 workstation is called "sol" and the
4.1.x server is called "bertha" and you want the printer name
to be "printer" (imaginative, eh?).
sol# lpsystem -t bsd bertha # says bertha is a bsd system
sol# lpadmin -p printer -s bertha # creates "printer" on "sol"
# to be printed on "bertha"
sol# accept printer # allow queuing
sol# enable printer # allow printing
sol# lpstat -t # check the status
sol# lpadmin -d printer # default
To get transparent mode, try this:
lpadmin -I any -p printer
* Pakety v Linux RedHat *
Postavit' paket
rpm -i filesystem-1.2-1.i386.rpm
Udalit' paket
rpm --erase filesystem-1.2-1
Spisok vseh paketov
rpm -qa
Spisok fajlov, vhodyashchih v neustanovlennyj paket:
rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it
rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it rpm2cpio < packet
name-1.2-1.i386.rpm | cpio -it
rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it
Spisok fajlov, vhodyashchih v ustanovlennyj paket:
rpm -l nfs-server-2.2beta16-5
Apdejty k RedHat lezhat zdes'. Obyazatel'no stavit' security updates
ftp://ftp.funet.fi/pub/Linux/mirrors/redhat/redhat/redhat-4.2/updates/i386/
Ustanovka apdejta
rpm -Uvh samba-1.9.18p7-0.i386.rpm
Pakety v HP-UX stavyatsya cherez podmenyushku SAM.
Spisok vseh paketov
swlist -l product
swpackage
/usr/sbin/swpackage -s $DEPOTDATA/$PSFFILE -x media_type=tape @ $DEPOTDIR/$DEPOTNAME.depot;
Delaesh' fajl psf (chitat' man 5 swpackage), zapuskaesh' vysheupomyanutuyu
kommandochku kak tebe nuzhno i poluchaesh')
format psf priblizitel'no takoj:
# PSF file which defines an example product.
depot
layout_version 1.0
# Vendor definition:
vendor
tag AS
title Kaspersky Labs, Ashmanov & Partners
description AS Software Distributor
category
tag antivirus_sft
title Antiviral Sofware
description These are the aniviral software
revision 1.0
end
# Product definition:
product
tag VSAPI
revision A.@VSAPI_VERSION@
architecture @OS@_@OS_RELEASE@_32/64
vendor_tag AS
title The aniviral software, HP OpenMail Kaspersky Labs VSAPI patch
number B2002A
category_tag openmail_path
description < data/descr.sd
copyright < data/copyr.sd
readme < data/README
machine_type *
os_name @OS@
os_release ?.@OS_NUMBER@.*
os_version ?
directory /
is_locatable false
# Create a product script which executes during the swremove
# analysis phase. (This particular script returns an ERROR,
# which prevents the removal of the VSAPI product.)
fileset
tag Files
file ./vsapi/libvsapi.@so_suffix@ /etc/iscan/libvsapi.@so_suffix@
file ./vsapi/vsapi.cfg /etc/iscan/vsapi.cfg
file ./openmail_var/rules/ALL-ROUTES.VIR_2
/var/opt/openmail/rules/ALL-ROUTES.VIR
file ./openmail_var/rules/ndninfo.txt
/var/opt/openmail/rules/ndninfo.txt
#control_files
postinstall ./data/postinstall
postremove ./data/postremove
end
Last-modified: Tue, 26 Nov 2002 18:40:05 GMT