LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-10-2004, 08:02 AM   #1
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 37
Lightbulb Diskset package removal


Please test the following script and post back any comments improvements.

Not the world's best googler so I wrote this script to remove ALL packages for a selected diskset (is subdirectory: gnome,kde...). Copy to /var/log/setup/setup.rmseries setting ownship root/root and permissions. Then run pkgtool.

Begin script copy***************************
#!/bin/sh
#BLURB="Remove ALL pkgs in a selected 'diskset'"
#
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi

cat << EOF > $TMP/tempmsg
First, you should have already mounted your source files.
Best results are achieved by using the source you used to build
this host with. \n
RmSeries uses the tagfile in a selected series to determine which
files to remove. Removepkg just throws an error message
if you tell it to remove a non-installed package. Thus, its not worth
the code to figure out which packages in tagfile are actually installed.
So be prepared to see "No such package.."\n
Next screen will ask for your mount point. The script expects to be at the
directory ABOVE /Slackware/[a ap d ...] . Maybe /mnt/cdrom , note there
is no trailing '/' .
Lastly, just the short name is used ie 'apache'. No version #, no build#,
THUS if your special package has a short name similiar to a Slackware package
keep your .tgz handy.\n
Continue ?
EOF
dialog --title "Welcome to RmSeries" --yesno "`cat $TMP/tempmsg`" 0 0
if [ ! $? = 0 ]; then
exit
fi
rm -f $TMP/SeThost $TMP/tempmsg

cat << EOF > $TMP/tempmsg
This script needs your source mount point.
Enter mount point:
EOF
#Uncomment next two lines , modifing directory info on second line
#Don't count this line! Then comment out lines 3&4 below
# dialog --title "ENTER Source Mount Point" --inputbox "`cat $TMP/tempmsg`" 11 65 \
# /home/ftp/pub/Slackware-10.0 $HOSTNM 2> $TMP/SeThost
dialog --title "ENTER Source Mount Point" --inputbox "`cat $TMP/tempmsg`" 8 65 \
2> $TMP/SeThost

if [ ! $? = 0 ]; then
exit
fi
HOSTNM=`cat $TMP/SeThost`
rm -f $TMP/SeThost $TMP/tempmsg

if ! cd $HOSTNM/slackware 1> /dev/null 2> /dev/null; then
dialog --title "Slackware directory NOT found!" --msgbox "Sorry, but '$HOSTNM' \
does not have the subdirectory 'Slackware'. You must mount your Slackware \
files (cd or nfs) prior to running this script. REMEMBER the script looks for the \
directory ABOVE /Slackware/[a ap d ...] . \
You'll have to try to again after properly mounting your source." 9 70
exit
fi
rm -f $TMP/SeTSERIES $TMP/tmpscript

cat << EOF > $TMP/tmpscript
dialog --title "PACKAGE SERIES DELETION" --item-help --radiolist \\
"Select which general category of software to DELETE from your system. \\
Use the spacebar to select the software group you wish to DELETE. \\
You can only delete ONE Package series at a time. \\
You can use the up and down arrows to see all the possible choices. \\
You can also goto a package by typing the first letter. \\
NOTE: You can not use this for the A - Base series. There you must \\
remove individual packages with removepkg. \\
Press the ENTER key when you are finished." \\
20 75 9 \\
"AP" "Various Applications that do not need X" off "The AP series is a collection of useful applications." \\
"D" "Program Development (C, C++, Lisp, Perl, etc.)" off "The D series contains compilers, debuggers, and other programming tools." \\
"E" "GNU Emacs" off "The E series contains the GNU Emacs advanced real-time display editor." \\
"F" "FAQ lists, HOWTO documentation" off "The F series contains essential documentation for Linux system administrators." \\
"GNOME" "The GNOME desktop for X" off "The GNOME series contains the GNOME desktop environment and related libraries." \\
"K" "Linux kernel source" off "The K series contains the source code for the Linux kernel." \\
"KDE" "Qt and the K Desktop Environment for X" off "The KDE series contains the K Desktop Environment and related libraries." \\
"KDEI" "International language support for KDE" off "The KDEI series provides support for languages other than US English in KDE." \\
"L" "System Libraries (some needed by both KDE and GNOME)" off "The L series contains libraries needed by GNOME, KDE, and other programs." \\
"N" "Networking (TCP/IP, UUCP, Mail, News)" off "The N series contains network related clients and servers." \\
"T" "TeX typesetting software" off "TeX is a typesetting system often used for mathematics and technical papers." \\
"TCL" "Tcl/Tk script languages" off "The TCL series contains the Tcl/Tk/TclX languages and programs that use them." \\
"X" "XFree86 X Window System" off "The X series contains XFree86, the window system used by Linux." \\
"XAP" "X Applications" off "The XAP series is a collection of applications for X." \\
"Y" "Games" on "The Y series contains a collection of classic text-based games." \\
2> $TMP/series
EOF
. $TMP/tmpscript

if [ ! $? = 0 ]; then
rm -f $TMP/SeThost $TMP/tempmsg
exit
fi
SERIES="`cat $TMP/series | tr A-Z a-z`"
rm -f $TMP/tmpscript $TMP/series

if [ ! -r $HOSTNM/slackware/$SERIES/tagfile ] 1> /dev/null 2> /dev/null; then
dialog --title "$SERIES tagfile NOT found!" --msgbox "Sorry, but\
'$HOSTNM/slackware/$SERIES' does not contain a tagfile \n
You'll have to try to again after checking your source files." 7 70
exit
fi
cat $HOSTNM/slackware/$SERIES/tagfile | sed -e '/^#/d' | cut -f 1 -d ':' > $TMP/PKGtoRM

for i in `cat $TMP/PKGtoRM`; do
/sbin/removepkg $i
done
rm -f $TMP/PKGtoRM

******************End script copy***********************
 
  


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
removal invinciblegod Linux - Laptop and Netbook 3 06-06-2005 03:47 PM
need guidence on indivisual package removal and download accelerator corelover Fedora 14 03-08-2005 10:46 AM
GRUB removal(I can't) JacKenshin SUSE / openSUSE 3 01-29-2005 05:15 PM
MBR Removal Aussie_Ocka Linux - Newbie 3 09-09-2004 02:17 AM
Removal of Linux tszhim Linux - Software 16 06-02-2003 10:49 PM

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

All times are GMT -5. The time now is 12:36 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