LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-05-2013, 04:14 PM   #1
slacker2012
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Rep: Reputation: Disabled
Any way to save package selections for future install??


Is there a way to save the package install information for a future install? I install Slack on a BUNCH of different PCs around the office and I would like to have a way of automatically selecting the packages I need. I dont need things like aspell, cd burning, odd libraries etc for my simple web servers.

Any ideas?
 
Old 03-05-2013, 04:50 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Have you considered something like Puppet or Chef?
 
Old 03-05-2013, 04:52 PM   #3
slacker2012
LQ Newbie
 
Registered: Feb 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Never heard of them until now. Do you have any more info on this?
 
Old 03-05-2013, 04:58 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
I love puppet, its a very intuitive and easy to use language. You basically just set your profile that says it requires this package and this version and then puppet does a run on the systems,(by default every 30 minutes) and will verify that the packages are the correct version. There is no if, else statements you have to write to check for versions all you do is say:

Code:
    package { 'openssh-server':
      ensure => 4.3p2-29.el5,
          }
It will make sure that your openssh-server package is 4.3p2-29.el5 and if its not will automatically resolve dependencies and install the correct version. You arent limited to just packages you can put a base config in for basically anything on the system.

Check out https://downloads.puppetlabs.com/doc...ningpuppet.pdf

They have a prebuilt VM that you can download and try out that already has the software installed and configured a little.
 
Old 03-05-2013, 05:07 PM   #5
Mike_M
Member
 
Registered: Mar 2011
Location: California
Distribution: Slackware
Posts: 116

Rep: Reputation: 53
You can use tagfiles for this. They are briefly discussed here:

http://docs.slackware.com/playground...install_option

I find the tagilfe format to be quite self explanatory. Once you've created your set (or sets) of tagfiles, it is a cinch to do repeated, automated installs.
 
1 members found this post helpful.
Old 03-05-2013, 06:38 PM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
See whether this script will help:

http://www.linuxquestions.org/questi...ckages-642787/

I've been using a slightly personalized version for several years. I always have a copy in /var/log of all non stock packages I installed. I run the script as part of my daily cron jobs.
 
Old 03-05-2013, 09:25 PM   #7
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by Woodsman View Post
See whether this script will help:

http://www.linuxquestions.org/questi...ckages-642787/

I've been using a slightly personalized version for several years. I always have a copy in /var/log of all non stock packages I installed. I run the script as part of my daily cron jobs.
All instances of ".tgz" would have to be changed to ".t[gx]z" or ".t.z" for those scripts to still work properly. If you use slackpkg then this script is nicer:
Code:
#!/bin/sh

(
cd /var/log/packages
THIRDPARTYPKGS=$(
    for i in *
    do
        if ! grep "^PACKAGE NAME:  ${i}.t[gx]z$" /var/lib/slackpkg/PACKAGES.TXT >/dev/null 2>&1; then
            echo "$i"
        fi
    done
)
echo "$THIRDPARTYPKGS"
)
To list all first-party packages instead of third-party packages (which seems to be what the OP wants), the slackpkg-dependent script should be
Code:
#!/bin/sh

(
cd /var/log/packages
FIRSTPARTYPKGS=$(
    for i in *
    do
        if grep "^PACKAGE NAME:  ${i}.t[gx]z$" /var/lib/slackpkg/PACKAGES.TXT >/dev/null 2>&1; then
            echo "$i"
        fi
    done
)
echo "$FIRSTPARTYPKGS"
)
By slackpkg-dependent I mean it depends on having run `slackpkg update` at least once. If you don't use slackpkg then you may adjust one of the scripts Woodsman linked to (the script in reply #9 has an option to list first-party packages, but since I no longer use the script I can't guarantee it still works -- though it should if you replace .tgz with .t[xg]z).

I just rigged up a quick script that produces tagfiles from the installed packages (using official packages only). This is also slackpkg-dependent.
Code:
#!/bin/bash

PACKAGES=/var/lib/slackpkg/PACKAGES.TXT
OUTPUTDIR=${OUTPUTDIR:-`pwd`}

(
cd /var/log/packages
PKGLIST=$(paste -d/ <(grep "^PACKAGE LOCATION:" $PACKAGES | sed 's/^PACKAGE LOCATION:  //') <(grep "^PACKAGE NAME:" $PACKAGES | sed 's/^PACKAGE NAME:  //'))
while read line
do
    if [ -e "$(basename $line)" ]; then
        mkdir -p "$OUTPUTDIR/$(dirname $line)"
        echo "$(echo "$(basename $line)" | rev | cut -d- -f4- | rev):ADD" >> "$OUTPUTDIR/$(dirname $line)/tagfile"
    else
        mkdir -p "$OUTPUTDIR/$(dirname $line)"
        echo "$(echo "$(basename $line)" | rev | cut -d- -f4- | rev):SKP" >> "$OUTPUTDIR/$(dirname $line)/tagfile"
    fi
done < <(echo "$PKGLIST" | sed 's/[.]t[gx]z$//')
)
This will create a few directories in the path specified by OUTPUTDIR (by default the current directory). It should create extra/, patches/, slackware/ (or slackware64/) and testing/ directories (some of which have their own sub-directories), but the only important one is slackware{,64}. It should be noted that this will not handle a patched Slackware installation properly -- any upgraded packages will be listed as "SKP" in the relevant tagfile instead of "ADD". Thus, after running the script you should look at patches/packages/tagfile and modify the appropriate tagfiles under slackware{,64}/ to change the upgraded packages to ADD instead of SKP. There isn't really an easy way to do this in the script since some packages may have ambiguous roots (xf86-video-nouveau, for example, could be the one from x/, testing/, or the blacklist package from extra/, and hypothetically, if a patch was released, the script would not be able to tell which package the patch represented...). I think it is best to leave this for manual work. The following script, which must be run from the directory specified as $OUTPUTDIR from the last script (after running it), will try to adjust for the patches problem automatically, but no guarantees:
Code:
#!/bin/bash

PATCHES=$(grep ":ADD$" patches/packages/tagfile | cut -d: -f1)
while read line
do
    PKG=$(grep -R "^${line}:SKP$" slackware{,64}/ 2>/dev/null | cut -d: -f1)
    sed -i "s/^${line}:SKP$/${line}:ADD/" $PKG
done < <(echo "$PATCHES")
For a simpler script see here, which uses a CD image/mirror (but will not omit official packages that you have replaced with unofficial packages -- it just checks to see if any package of the given name is installed regardless of whether or not it is official).

To use the tagfiles generated by my script, you would pass the name of the slackware{,64} directory to the installer and not $OUTPUTDIR (I believe the installer looks for tagfiles in a/, ap/, etc. directories under the mount point).
 
Old 03-05-2013, 09:51 PM   #8
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Kustom42 View Post
Have you considered something like Puppet or Chef?
Have you considered that Slackware is not a supported platform for Puppet? You do know that Slackware isn't like RedHat, don't you?
 
Old 03-06-2013, 12:36 AM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
In a Slackware tree, in every directory under /slackware storing a package series (e.g. a, ap, d, e, f ... y) you'll find three files: tagfile, maketag and maketag.ez.

You can use the 'maketag' scripts in two ways:
(1) Directly running "sh maketag" as root. The program will allow you to select/unselect every package in that series and output a customized tagfile called /var/log/setup/tmp/SeTnewtag that you can rename for instance as tagfile.pat (well, that's how Pat used to call them :-) and copy back in the packages' series directory. Then you make an ISO of the Slackware tree including the customized tagfiles and choose the option to use that during installations.
(2) During installation, run the SeTmaketag program to somehow automatize the process.
You may run that as soon as you have logged in as (fake) root, before running setup.

For the records, once upon a time 'maketag' allowed to choice among groups of packages whilst with 'maketag.ez' was intended to make you select/unselect packages individually (so called "expert" mode) but in Slackware.14 there is no packages grouping and both files' content is identical.

FYI I attach a copy of the SeTmaketag script found in the installer for Slackware-14.0., renamed to allow its uploading on LQ.

You can run it any time (as root) to prepare your customized tagfiles, provided you have a local mirror. Editing the script to ask for the mirror's path only once for all packages' series is left to the reader as an exercise

PS wondering why SeTmaketag is in the installer, not as another Slackware script in /sbin (or /usr/sbin)? I'd guess that's because when it was first shipped Slackware installation media were floppy disks and the script allowed to write the custom tagfiles on the first floppy of each packages series, that way the floppies could then be used to make as many custom installations as needed.

PS2 nothing actually new here. As stated in SeTmaketag "The maketag script was introduced in Slackware 1.1.2"
Attached Files
File Type: txt SeTmaketag.txt (5.9 KB, 15 views)

Last edited by Didier Spaier; 03-06-2013 at 11:12 AM.
 
Old 03-06-2013, 04:40 PM   #10
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Sorry for the incorrect info here, I didnt realize I got onto the slackware threads. Yes slackware is much different and puppet will not work.

Last edited by Kustom42; 03-06-2013 at 04:42 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing large package selections Novatian Ubuntu 1 09-29-2012 11:05 AM
LXer: Copying Debian package selections to a new machine LXer Syndicated Linux News 0 10-07-2010 08:00 AM
LXer: Duplicating subsets of package selections between systems LXer Syndicated Linux News 0 05-15-2010 08:00 PM
Suse 9.2 package selections seems smaller Doug.Gentry SUSE / openSUSE 4 01-26-2005 06:30 PM
Package selections for Server Install (Mandrake & Fedora) Ollie46 Linux - Security 1 07-23-2004 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration