LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (http://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   1. Expunge new install of all kde; & 2.exclude kde from further updates & upgrades (http://www.linuxquestions.org/questions/slackware-installation-40/1-expunge-new-install-of-all-kde%3B-and-2-exclude-kde-from-further-updates-and-upgrades-4175462302/)

textillis 05-17-2013 02:09 AM

1. Expunge new install of all kde; & 2.exclude kde from further updates & upgrades
 
Hi folks,

Linux noob here.

My subject line asks my question.

I would greatly appreciate some code to execute these 2 operations.

Thx,
Tex

A quotation that is exercising my imagination today, from Sam Johnson, 18thCentury lexicographer, latinist, conversationalist and great contrarian:
"There are two types of knowledge in the world: that which one finds in books and that concerning where those books can be found"
I thought: how apt this is when applied -mutatis mutandis- to the process of acquiring a rough-n-ready took-kit for linux, and for slackware in particular.

TobiSGD 05-17-2013 06:12 AM

1.
Code:

slackpkg remove kde kdei
2. Not necessary if no KDE packages are installed.

textillis 05-17-2013 06:18 AM

Quote:

Originally Posted by TobiSGD (Post 4953033)
1.
Code:

slackpkg remove kde kdei
2. Not necessary if no KDE packages are installed.


Very much appreciated.

Diantre 05-17-2013 06:32 AM

1) Go to the "slackware64/kde" directory in your Slackware DVD (or other installation media):

Code:

# cd /path/to/SlackDVD/slackware64/kde
# for i in $(cat tagfile); do removepkg ${i%%:*}; done

The tagfile contains a list of all KDE packages that setup installs (all of them, not only the ones with "kde" in their name). The for line invokes removepkg with each package name.

2) Nothing to do. Since KDE is no longer in the system, slackpkg won't upgrade it (when using slackpkg upgrade-all).

But if you upgrade the system to a new Slackware stable or -current, the slackpkg install-new command will put the KDE packages back. In that case you need to blacklist the KDE packages:

Code:

# cd /path/to/SlackDVD/slackware64/kde
# for i in $(cat tagfile); do echo ${i%%:*} >> /etc/slackpkg/blacklist; done

The command above adds all KDE package names to the blacklist file. But this blacklist would work only if there are no new or renamed KDE packages in the new Slackware stable or -current, otherwise some unwanted packages might get installed in the upgrade process. In this case, it would be necessary to manually add the package names to /etc/slackpkg/blacklist.

If you want KDE back, either use

Code:

# slackpkg install-new
to install it from a mirror, or

Code:

# cd /path/to/SlackDVD/slackware64/kde
# installpkg *txz

to install KDE from your Slackware DVD.

Suggestion: Read the manpages for slackpkg, installpkg, removepkg and upgradepkg so you get acquainted with these tools.

Important: Be extra careful whenever you're removing stuff. Make backups of your data. RTFM. :)

Hope that's clear. Ask, if in doubt.

textillis 05-17-2013 11:05 AM

Mighty helpful. Thanks Diantre.
I'll file the code away and follow your advice by doing
the reading before taking the action!

Miranden 05-19-2013 09:56 PM

Quote:

Originally Posted by Diantre (Post 4953042)
1) Go to the "slackware64/kde" directory in your Slackware DVD (or other installation media):

Code:

# cd /path/to/SlackDVD/slackware64/kde
# for i in $(cat tagfile); do removepkg ${i%%:*}; done

The tagfile contains a list of all KDE packages that setup installs (all of them, not only the ones with "kde" in their name). The for line invokes removepkg with each package name.

2) Nothing to do. Since KDE is no longer in the system, slackpkg won't upgrade it (when using slackpkg upgrade-all).

But if you upgrade the system to a new Slackware stable or -current, the slackpkg install-new command will put the KDE packages back. In that case you need to blacklist the KDE packages:

Code:

# cd /path/to/SlackDVD/slackware64/kde
# for i in $(cat tagfile); do echo ${i%%:*} >> /etc/slackpkg/blacklist; done

The command above adds all KDE package names to the blacklist file. But this blacklist would work only if there are no new or renamed KDE packages in the new Slackware stable or -current, otherwise some unwanted packages might get installed in the upgrade process. In this case, it would be necessary to manually add the package names to /etc/slackpkg/blacklist.

If you want KDE back, either use

Code:

# slackpkg install-new
to install it from a mirror, or

Code:

# cd /path/to/SlackDVD/slackware64/kde
# installpkg *txz

to install KDE from your Slackware DVD.

Suggestion: Read the manpages for slackpkg, installpkg, removepkg and upgradepkg so you get acquainted with these tools.

Important: Be extra careful whenever you're removing stuff. Make backups of your data. RTFM. :)

Hope that's clear. Ask, if in doubt.

I really appreciate posts like this. Thanks for your time here.

quiescere 05-21-2013 04:07 PM

Quote:

Originally Posted by Diantre (Post 4953042)
1) Go to the "slackware64/kde" directory in your Slackware DVD (or other installation media):
Code:

# cd /path/to/SlackDVD/slackware64/kde
# for i in $(cat tagfile); do removepkg ${i%%:*}; done


This was an excellent post. I have one question: in the 'for' line above, what does the ${i%%:*} do? I am not familiar with that construction, particularly what the %%:* does to modify ${i}.

Diantre 05-21-2013 04:36 PM

Quote:

Originally Posted by quiescere (Post 4955976)
I have one question: in the 'for' line above, what does the ${i%%:*} do? I am not familiar with that construction, particularly what the %%:* does to modify ${i}.

The ${string%%substring} is a bash construct that removes the longest match of substring from the back of string.

In the tagfile, the packages have a keyword that indicates if the package is installed automatically or not, or if the user is prompted to install it. For example, from the KDE tagfile:

Code:

amarok:OPT
ark:REC
kdelibs:ADD

The ${i%%:*} removes characters from the back of $i, from ':' to the end of the string, indicated by '*'. So we get the packages names without the ':*' at the end:

Code:

amarok
ark
kdelibs

You can read more about the tagfiles in the SlackBook, and the Advanced Bash Scripting book has details about string manipulation.

quiescere 05-22-2013 05:23 PM

Thanks very much: that's good to know.


All times are GMT -5. The time now is 12:16 AM.