summaryrefslogtreecommitdiffstats
path: root/slackbook/html/package-management-package-utilities.html
blob: 0179a5a81dc75ce75624b22e303651c6c6bbdd3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Package Utilities</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="UP" title="Slackware Package Management" href="package-management.html" />
<link rel="PREVIOUS" title="Slackware Package Management"
href="package-management.html" />
<link rel="NEXT" title="Making Packages"
href="package-management-making-packages.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>

<tr>
<td width="10%" align="left" valign="bottom"><a href="package-management.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 18 Slackware Package
Management</td>
<td width="10%" align="right" valign="bottom"><a
href="package-management-making-packages.html" accesskey="N">Next</a></td>
</tr>
</table>

<hr align="LEFT" width="100%" />
</div>

<div class="SECT1">
<h1 class="SECT1"><a id="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES"
name="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES">18.2 Package Utilities</a></h1>

<p>There are four main utilities for package management. They perform installation,
removal, and upgrades of packages.</p>

<div class="SECT2">
<h2 class="SECT2"><a id="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-PKGTOOL"
name="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-PKGTOOL">18.2.1 pkgtool</a></h2>

<p><tt class="COMMAND">pkgtool</tt>(8) is a menu-driven program that allows installation
and removal of packages. The main menu is shown in <a
href="package-management-package-utilities.html#PKGTOOL-MAIN-MENU">Figure 18-1</a>.</p>

<div class="FIGURE"><a id="PKGTOOL-MAIN-MENU" name="PKGTOOL-MAIN-MENU"></a>
<p><b>Figure 18-1. Pkgtool's main menu.</b></p>

<p><img src="package-management/pkgtool-w.png" /></p>
</div>

<p>Installation is offered from the current directory, another directory, or from floppy
disks. Simply select the installation method you want and pkgtool will search that
location for valid packages to install.</p>

<p>You may also view a list of installed packages, as shown in <a
href="package-management-package-utilities.html#PKGTOOL-VIEW-MODE">Figure 18-2</a>.</p>

<div class="FIGURE"><a id="PKGTOOL-VIEW-MODE" name="PKGTOOL-VIEW-MODE"></a>
<p><b>Figure 18-2. Pkgtool view mode</b></p>

<p><img src="package-management/pkgtool-view-w.png" /></p>
</div>

<p>If you want to remove packages, select the remove option and you will be presented
with a checklist of all the installed packages. Flag the ones you want to remove and
select OK. <tt class="COMMAND">pkgtool</tt> will remove them.</p>

<p>Some users prefer this utility to the command line utilities. However, it should be
noted that the command line utilities offer many more options. Also, the ability to
upgrade packages is only offered through the command line utilities.</p>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-INSTALLPKG"
name="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-INSTALLPKG">18.2.2 installpkg</a></h2>

<p><tt class="COMMAND">installpkg</tt>(8) handles installation of new packages on the
system. The syntax is as follows:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">#</samp> <kbd class="USERINPUT">installpkg option package_name</kbd>
</pre>
</td>
</tr>
</table>

<p>Three options are provided for <tt class="COMMAND">installpkg</tt>. Only one option
can be used at a time.</p>

<div class="TABLE"><a id="AEN6446" name="AEN6446"></a>
<p><b>Table 18-1. <tt class="COMMAND">installpkg</tt> Options</b></p>

<table border="0" frame="void" class="CALSTABLE">
<col width="1*" />
<col width="3*" />
<thead>
<tr>
<th align="LEFT">Option</th>
<th align="LEFT">Effects</th>
</tr>
</thead>

<tbody>
<tr>
<td>-m</td>
<td>Performs a makepkg operation on the current directory.</td>
</tr>

<tr>
<td>-warn</td>
<td>Shows what would happen if you installed the specified package. This is useful for
production systems so you can see exactly what would happen before installing
something.</td>
</tr>

<tr>
<td>-r</td>
<td>Recursively install all packages in the current directory and down. The package name
can use wildcards, which would be used as the search mask when recursively
installing.</td>
</tr>
</tbody>
</table>
</div>

<p>If you pass the <tt class="ENVAR">ROOT</tt> environment variable before <tt
class="COMMAND">installpkg</tt>, that path will be used for the root directory. This is
useful for setting up new drives for your root directory. They will typically be mounted
to <tt class="FILENAME">/mnt</tt> or something other than <tt
class="FILENAME">/</tt>.</p>

<p>The installed package database entry is stored in <tt
class="FILENAME">/var/log/packages</tt>. The entry is really just a plain text file, one
for each package. If the package has a postinstallation script, it is written to <tt
class="FILENAME">/var/log/scripts/</tt>.</p>

<p>You may specify several packages or use wildcards for the package name. Be advised
that <tt class="COMMAND">installpkg</tt> will not tell you if you are overwriting an
installed package. It will simply install right on top of the old one. If you want to
ensure that old files from the previous package are safely removed, use <tt
class="COMMAND">upgradepkg</tt>.</p>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-REMOVEPKG"
name="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-REMOVEPKG">18.2.3 removepkg</a></h2>

<p><tt class="COMMAND">removepkg</tt>(8) handles removing installed packages from the
system. The syntax is as follows:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">#</samp> <kbd class="USERINPUT">removepkg option package_name</kbd>
</pre>
</td>
</tr>
</table>

<p>Four options are provided for <tt class="COMMAND">removepkg</tt>. Only one option may
be used at a time.</p>

<div class="TABLE"><a id="AEN6491" name="AEN6491"></a>
<p><b>Table 18-2. <tt class="COMMAND">removepkg</tt> Options</b></p>

<table border="0" frame="void" class="CALSTABLE">
<col width="1*" />
<col width="3*" />
<thead>
<tr>
<th>Option</th>
<th>Effects</th>
</tr>
</thead>

<tbody>
<tr>
<td>-copy</td>
<td>The package is copied to the preserved packages directory. This creates a tree of the
original package without removing it.</td>
</tr>

<tr>
<td>-keep</td>
<td>Saves temporary files created during the removal. Really only useful for debugging
purposes.</td>
</tr>

<tr>
<td>-preserve</td>
<td>The package is removed, but copied to the preserved packages directory at the same
time.</td>
</tr>

<tr>
<td>-warn</td>
<td>Shows what would happen if you removed the package.</td>
</tr>
</tbody>
</table>
</div>

<p>If you pass the <tt class="ENVAR">ROOT</tt> environment variable before <tt
class="COMMAND">removepkg</tt>, that path will be used for the root directory. This is
useful for setting up new drives for your root directory. They will typically be mounted
to <tt class="FILENAME">/mnt</tt> or something other than <tt
class="FILENAME">/</tt>.</p>

<p><tt class="COMMAND">removepkg</tt> looks at the other installed packages and only
removes files unique to the package you specify. It will also scan the postinstallation
script for the specified package and remove any symbolic links that were created by
it.</p>

<p>During the removal process, a status report is displayed. After the removal, the
package database entry is moved to <tt class="FILENAME">/var/log/removed_packages</tt>
and the postinstallation script is moved to <tt
class="FILENAME">/var/log/removed</tt>_scripts.</p>

<p>Just as with <tt class="COMMAND">installpkg</tt>, you can specify several packages or
use wildcards for the package name.</p>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-UPGRADEPKG"
name="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-UPGRADEPKG">18.2.4 upgradepkg</a></h2>

<p><tt class="COMMAND">upgradepkg</tt>(8) will upgrade an installed Slackware package.
The syntax is as follows:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">#</samp> <kbd class="USERINPUT">upgradepkg package_name</kbd>
</pre>
</td>
</tr>
</table>

<p>or</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">#</samp> <kbd
class="USERINPUT">upgradepkg old_package_name%new_package_name</kbd>
</pre>
</td>
</tr>
</table>

<p><tt class="COMMAND">upgradepkg</tt> works by first installing the new package and then
removing the old package so that old files are no longer around on the system. If the
upgraded package name has changed, use the percent sign syntax to specify the old package
(the one that is installed) and the new package (the one you are upgrading it to).</p>

<p>If you pass the <tt class="ENVAR">ROOT</tt> environment variable before <tt
class="COMMAND">upgradepkg</tt>, that path will be used for the root directory. This is
useful for setting up new drives for your root directory. They will typically be mounted
to <tt class="FILENAME">/mnt</tt> or something other than <tt
class="FILENAME">/</tt>.</p>

<p><tt class="COMMAND">upgradepkg</tt> is not flawless. You should always back up your
configuration files. If they get removed or overwritten, you'll want a copy of the
originals for any needed repair work.</p>

<p>Just as with <tt class="COMMAND">installpkg</tt> and <tt
class="COMMAND">removepkg</tt>, you can specify several packages or use wildcards for the
package name.</p>
</div>

<div class="SECT2">
<h2 class="SECT2"><a id="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-RPM"
name="PACKAGE-MANAGEMENT-PACKAGE-UTILITIES-RPM">18.2.5 <tt
class="COMMAND">rpm2tgz</tt>/<tt class="COMMAND">rpm2targz</tt></a></h2>

<p>The Red Hat Package Manager is a popular packaging system available today. Many
software distributors are offering their products in RPM format. Since this is not our
native format, we do not recommend people rely on them. However, some things are only
available as an RPM (even the source).</p>

<p>We provide a program that will convert RPM packages to our native <tt
class="FILENAME">.tgz</tt> format. This will allow you to extract the package (perhaps
with <tt class="COMMAND">explodepkg</tt>) to a temporary directory and examine its
contents.</p>

<p>The <tt class="COMMAND">rpm2tgz</tt> program will create a Slackware package with a
<tt class="FILENAME">.tgz</tt> extension, while <tt class="FILENAME">rpm2targz</tt>
creates an archive with a <tt class="FILENAME">.tar.gz</tt> extension.</p>
</div>
</div>

<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="package-management.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a
href="package-management-making-packages.html" accesskey="N">Next</a></td>
</tr>

<tr>
<td width="33%" align="left" valign="top">Slackware Package Management</td>
<td width="34%" align="center" valign="top"><a href="package-management.html"
accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Making Packages</td>
</tr>
</table>
</div>
</body>
</html>