aboutsummaryrefslogtreecommitdiffstats
path: root/FAQ
blob: 6a1dedfecaf45ba237ac1100f38b6582f826513b (plain)
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
Frequenty Asked Questions:

*Contents
1.  What is slapt-get ?
2.  Why yet another package management tool for slackware?
3.  How do I build/install slapt-get?  How do I remove slapt-get?
4.  How do I find a package I want to install?
5.  Can I upgrade all my installed packages?
6.  How can I see what will be upgraded without upgrading?
7.  What if I only want to download the updates?
8.  How can I re-install an existing package?
9.  Can I "dist-upgrade" to a newer Slackware release?
10. What about package dependancies?
11. What about multiple package sources, ala linuxpackages.net?
12. I don't like the download spinner, how can I get more statistics?
13. How can I install every available package?
14. What if I only want to upgrade one package?
15. What about Dropline support?
16. How can I generate an exclude list for an entire disk set?
17. How do I use a local file source?



1.  What is slapt-get ?

 slapt-get is an APT like system for Slackware package management. It allows
 one to search slackware.com and mirrors for packages, compare them with
 installed packages, install new packages or upgrade installed packages all
 with a few simple commands. Great for scripting as well.

2.  Why yet another package management tool for slackware?

 To scratch and itch of mine, which also scratched an itch of a friend.  I
 created it originally without looking for an existing solution.  I now
 understand Slackware already has existing utilities that provide similar
 functionality.  I believe slapt-get to be superior because of it's speed and
 simplicity.  I do not believe slapt-get takes away anything from these
 existing tools.  slapt-get can stand on it's own merits.  I think choice is
 great for the end user (see Gnome vs KDE).  I do not aim for inclusion
 within Slackware.  I simply make this available in hopes others will find
 it useful.
 
3.  How do I build/install slapt-get?  How do I remove slapt-get?

 Two ways to install:

  A: You can build slapt-get from source and use the 'install' make target,
 
  B: You can build from source and make a Slackware package with the 'pkg'
     make target.  Then install the generated package within the newly created
     'pkg' directory.

 If you installed via `make install`, there is an 'uninstall' make target.

 If you installed the slack package, then use removepkg.

4.  How do I find a package I want to install?

 You can use the --search feature, supplying an expression.  POSIX 
 regular expressions are supported.

5.  Can I upgrade all my installed packages?

 Yes, simply use the --upgrade option.  slapt-get will check for 
 newer versions of all packages already installed.

6.  How can I see what will be upgraded without upgrading?

 Use the --simulate option before --upgrade.
 See slapt-get --help

7.  What if I only want to download the updates?

 Use the --download-only option before --upgrade.
 See slapt-get --help

8.  How can I re-install an existing package?

 Use the --reinstall option before --install
 See slapt-get --help

9.  Can I "dist-upgrade" to a newer Slackware release?

 Yes.

 Change your source location within /etc/slapt-getrc to point to the newer
 release directory.  --update your local package data cache, then --upgrade
 to the newer release.

 For instance, you have the following uncommented line as your source:

  SOURCE=ftp://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-9.0/

 Simply change the url to point to current, like so:

  SOURCE=ftp://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-current/

 Now you simply --update to retrieve the package data for that release.

 CAVEAT: The simplicity of slapt-get means a lot of assurances are not in
         place.  You can break a working system if you do not follow the
         suggestions in UPGRADE.TXT.  This means doing the following:

           ### make sure you have all the packages for the upgrade locally
           $ slapt-get --download-only --upgrade

           ### switch to single user mode
           $ telinit 1

           ### first, upgrade the most important
           #(this installs any newer versions)
           $ slapt-get --install glibc-solibs
           $ slapt-get --install pkgtools
           $ slapt-get --install sed

           ### then, let slapt-get upgrade the rest
           $ slapt-get --upgrade

         Then follow the rest of the directions in UPGRADE.TXT.

         If you have a broken system, make sure aaa_base is at least installed.
         Make sure it's downloaded: slapt-get --download-only --install aaa_base
         Then untar it from /.

         Sometimes upgrades fail, make sure /bin/sh is either a binary or 
         symlink to `which bash`.

10.  What about package dependancies?

 Other tools try to provide dependancy checking via various hacks (generating
 the dependancy file, exploding the package, then ldd'ing binary files to find
 missing libraries before consulting the dependancy file).  This is not a
 reliable/fool proof method.  It is also extremely slow.

 I have sent Pat a request to include a requires field in the PACKAGES.TXT
 file that is shared with all the mirrors.  Since this information is known
 when the package is created, this is the best time/place to make that data
 available.  It is a simple progression from making a note within the package
 description such as the one already within the man package:

   man: man (format and display the on-line manual pages)
   man:
   man: The man package is a collection of tools used for searching and
   man: reading the online system documentation.  In fact, on most UNIX-like
   man: operating systems it is the primary means of finding out how programs
   man: on the system work.  For example, 'man man' will display the
   man: documentation for man itself.
   man:
   man: *-->*Man requires the groff text processing package.*<--*
   man:

 to providing that data in a way that can be scripted for those who have
 the advanced knowledge or want to provide higher level tools for Slackware.

 So Pat's generated PACKAGES.TXT file would need an addition to the
 package's entry, going from:

   PACKAGE NAME:  man-1.5l-i386-1.tgz
   PACKAGE LOCATION:  ./slackware/ap
   PACKAGE SIZE (compressed):  166 K
   PACKAGE SIZE (uncompressed):  390 K
   PACKAGE DESCRIPTION:
   man: man (format and display the on-line manual pages)

 to this (note only an additional line per package entry):

   PACKAGE NAME:  man-1.5l-i386-1.tgz
   PACKAGE LOCATION:  ./slackware/ap
   PACKAGE SIZE (compressed):  166 K
   PACKAGE SIZE (uncompressed):  390 K
   PACKAGE REQUIRES: groff,man-pages
   PACKAGE DESCRIPTION:
   man: man (format and display the on-line manual pages)

 which could be generated from a file such as: ./install/slack-required .

 He has declined the request at this time, citing a "niche" for a
 distribution without "dependancy hell".  I believe leaving out the requirement
 field does not prevent dependancy hell, it simply hides it, passing the burden
 on to the users and system administrators who simply want to be able to
 quickly install and deploy servers and services.  Yes it is good for new users
 to become familiar with the process of locating and resolving library
 dependancies.  But I think this becomes tedious after the initial lesson has
 been learned.  However, I am thankful for Pat's dedication to his goals and
 ideals.  So I have simply dropped the issue.

 I hope if the community as a whole agrees that this is an added benefit 
 (without becoming overly complex or kludgey) they can convince Pat there is
 a need/demand for it.

 We are working with the linuxpackages.net crew to integrate dependancy 
 with their package listing.

11. What about multiple package sources, ala linuxpackages.net?

 You can now use multiple sources with slapt-get (including linuxpackages.net).
 See the example slapt-getrc in the source tarball, or look in
 /etc/slapt-getrc.new if you installed via slackpack. See README.

12. I don't like the download spinner, how can I get more statistics?

 If you would like more notification on downloading pkgs/files, change the 
 USE_CURL_PROGRESS macro to 1 in include/curl.h.  This turns on curl's
 internal progress meter.  This requires a recompile.

13. How can I install every available package?

 Even though it's not built in, it's simple since slapt-get is easy to script
 with.  Here is a simple shell script to install every package that is
 available but not currently installed:

   #!/bin/sh
   # Dan Barber <danb at mojolin dot com>
   slapt-get --update
   slapt-get --installed > /tmp/slapt_get_installed
   for file in `slapt-get --list | cut -f1 -d" " | sort`
     do
     echo -n "$file "
     if [ -z "`grep "\W+$file\W+" /tmp/slapt_get_installed`" ]; then
       if [ -z "`grep '\W+$file\W?' /etc/slapt-getrc`" ]; then
         echo "excluded"
       else
         echo "not installed"
         slapt-get --install $file
       fi
     fi
   done



14. What if I only want to upgrade one package?

 Then you follow the debian apt-get method of using --install.
 If the package is already installed, it will check and install any newer
 versions:

 slapt-get --install {pkg_name}


15. What about Dropline support?

 There is no exception for dropline packages.  If you do not want them
 upgraded, either put the package names into the exception list or use 
 interactive mode (do not use --no-prompt, use --interactive).

16. How can I generate an exclude list for an entire disk set?

 You can use this script to generate a listing of packages to add to your
 exlude list:

   #!/bin/sh
   # this should gen an exclude list for a particular dir set (first arg to script)
   DIR=$1
   F=0
   for pkg in `./slapt-get --list|awk '{print $1}'`
   do
     if [ -n "`./slapt-get --show ${pkg}|grep 'Package Location'|awk '{print $3}'|egrep "\W+${DIR}"`" ]; then
       if [ $F == 1 ]; then
   echo -n ,$pkg
       else
   echo -n $pkg
       fi
       F=1
     fi
   done
   echo

17. How do I use a local file source?

 Within slapt-getrc, change your SOURCE= lines to point to file:// url's.

 For example, you could have an official and a local source like:
 SOURCE=ftp://ftp.slackware.no/pub/linux/slackware/slackware-9.1/
 SOURCE=file:///usr/src/local_pkg_repository/

 This local directory must have the PACKAGES.TXT and CHECKSUMS.md5 files present.

 The CHECKSUMS.md5 file can be generated with find:
  rm CHECKSUMS.md5; find . -name '*.tgz' -exec md5sum {} >> CHECKSUMS.MD5 \;

 The PACKAGES.TXT can be generated by the following script:

 ### BEGIN SCRIPT
        #!/bin/sh
        base_dir=`pwd`
        file_target=PACKAGES.TXT
        target=$base_dir/$file_target.tmp
        final_target=$base_dir/$file_target
        debugger=0
          ## initialize over size count for compressed and uncompressed
          totalcomp_k=0
          totaluncomp_k=0
        
        for ini_dir_struct in `find . | grep -m1 '\.tgz$'`
                do
        ## Path from script location to package, not including package
        ini_location=`echo $ini_dir_struct |\
        sed -re "s/([a-zA-Z0-9._\/-]+\/)([a-zA-Z0-9.+_-]+)-([a-zA-Z0-9._-]+).tgz/\1/"`
        
        ### Build Header for file
        echo "$file_target              `date`" > $target
        echo "" >> $target
        echo "This file provides details on the Slackware packages found " >> $target
        echo "in the ./ directory. " >> $target
        echo "" >> $target
        echo "Total size of all packages (compressed):  ZXaXZ MB " >> $target
        echo "Total size of all packages (uncompressed): ZXbXZ MB" >> $target
        	done
        
        
        for dir_struct in `find . | grep '\.tgz$'` 
        do
        
        	## File Name (xxxx-n.n.nbeta1-pre.tgz)
        #	name_o_file=`echo $dir_struct |\
        #		sed -re "s/([a-zA-Z0-9-\+_i.]+)*\///g"`
        name_o_file=`echo $dir_struct |sed -re "s/([a-zA-Z0-9._\/-]+\/)/\2/"`
        
        	## Base File Name, no version number (xxxx)
        	base_name=`echo $dir_struct |\
        		sed -re "s/([a-zA-Z0-9._\/-]+\/)([a-zA-Z0-9+_-]+)-([a-zA-Z0-9._-]+).tgz/\2/"`
        
        	## Path from script location to package, not including package
        	location=`echo $dir_struct |\
        		sed -re "s/([a-zA-Z0-9._\/-]+\/)([a-zA-Z0-9+_-]+)-([a-zA-Z0-9._-]+).tgz/\1/"`
        
        	## Size of file in KB
        	compressed=`gunzip -l $dir_struct | grep -v compress | awk '{print $1 }'`
        	uncompressed=`gunzip -l $dir_struct | grep -v compress | awk '{print $2 }'`
        	comp_k=`echo "${compressed}/1024" | bc`
        	uncomp_k=`echo "${uncompressed}/1024" | bc`
        	totalcomp_k=`expr $totalcomp_k + $comp_k`
        	totaluncomp_k=`expr $totaluncomp_k + $uncomp_k`
        
        	## Contents of slack-required
        	required=`tar ztf $dir_struct  | grep "slack-required" |\
        		xargs -r -i"XFILEZ" tar xzf $dir_struct  -O XFILEZ |\
        		xargs -r | sed "s/ /,/g"`
        
        	if [ $debugger -eq 1 ]; then
        	## Debug output to $target
        	echo "" >> $target
        	echo "dir_struct = $dir_struct" >> $target
        	echo "location = $location" >> $target
        	echo "name_o_file = $name_o_file" >> $target
        	echo "target = $target" >> $target
        	echo "base_dir = $base_dir" >> $target
        	echo "base_name = $base_name" >> $target
        	echo "total compressed size in KB = $totalcomp_k" >> $target
        	echo "total uncompressed size in KB = $totaluncomp_k" >> $target
        	echo "tar zxf $dir_struct -O install/slack-desc | grep ^${base_name}:" >> $target
        	 echo "" >> $target
        	fi
        
        
        	## Build PACKAGES.TXT
        
        	echo "" >> $target
        	echo "PACKAGE NAME:  $name_o_file" >> $target
        	echo "PACKAGE LOCATION:  $location" >> $target
        	echo "PACKAGE SIZE (compressed):  $comp_k K" >> $target
        	echo "PACKAGE SIZE (uncompressed):  $uncomp_k K" >> $target
        	echo "PACKAGE REQUIRED: $required" >> $target
        	echo "PACKAGE DESCRIPTION: " >> $target
        		tar ztf $dir_struct  | grep "slack-desc" |\
        		xargs -r -i"XFILEZ" tar xzf $dir_struct  -O XFILEZ |\
        		grep "^${base_name}:"  >> $target
        		
        	#tar zxf $dir_struct -O install/slack-desc | grep "^${base_name}:"  >> $target
        
        
        	## Count number of lines in desc... should be 11 (0+10)
        	## Append to description
        	        lines=`tar ztf $dir_struct  | grep "slack-desc" |\
                        xargs -r -i"XFILEZ" tar xzf $dir_struct  -O XFILEZ |\
                        grep "^${base_name}:" | wc -l`
        	#lines=`tar zxf $dir_struct -O install/slack-desc | grep "^${base_name}:" | wc -l`
        
        		while [ ${lines} -le 10 ]
        		do
        			echo "${base_name}:" >> $target
        			lines=`expr $lines + 1`
        		done
        
        done
        
        ## calculate totals in MB
        totalcomp_m=`expr $totalcomp_k / 1024`
        totaluncomp_m=`expr $totaluncomp_k / 1024`
        
        cat $target | \
        sed -e "s/ZXaXZ/$totalcomp_m/g" \
        -e "s/ZXbXZ/$totaluncomp_m/g" > $final_target && rm $target
 ### END SCRIPT