If you have KDE 3 installed and you're running ~arch, you have probably been confronted with KDE4 trying to get installed. Perhaps this has been something you've been waiting for for months, and you're happy to install it. However, many people don't want to run KDE4 just yet - maybe you find KDE 3.5 good enough and don't want to bother spending the time compiling 4.1 when you know you won't be using it and want to wait until 4.2 or for 4.3 ... Or maybe like me, you just want to install only certain parts of KDE but not every 4.1 variant of the KDE 3.5 application that you installed.
Your first idea would be to mask all the KDE4 packages. You could either acquire the whole list of packages from somewhere and put them into package.mask, or you could put packages one-by-one until no updates show up, which could be tedious especially if you were picky as to what KDE 3.5 apps get installed. However, masking has disadvantages. If you suddenly have an urge to install a certain app that's in your masked list, you have to unmask it and all on its dependencies.
You may ask yourself why KDE4 is getting pulled in in the first place. The reason is that in your world file, you have that package name, so as soon is as it sees that there's a new version of that package, ignoring that it will be in a different slot.
In this guide, we will use sets, a new Portage 2.2 feature, to prevent KDE4 from wanting to be installed. Unlike masking, nothing will prevent you from installing anything; rather, nothing will pull KDE4 in. As an added added bonus, it will make it easier for you to uninstall KDE 3.5 when that inevitable day eventually comes.
Step 1: Move things out of your world file
Let's begin. The first step is to move all the stuff from the world that is related to KDE to a separate file. It is located at /var/lib/portage/world If you don't trust yourself (or me), you may want to back it up.
Code: Select all
cp /var/lib/portage/world /root/worldStep 2: Create a set
Now that we have the list of packages, we can create a set. Make sure you have a directory called /etc/portage/sets/:
Code: Select all
mkdir -p /etc/portage/sets/Code: Select all
cat /tmp/kde-3.5 | while read line; do
echo "$line:3.5" >> /etc/portage/sets/kde-3.5;
doneCode: Select all
cat /tmp/kde-extras | while read line; do
echo "$line:0" >> /etc/portage/sets/kde-3.5;
doneLet's try it out:
Code: Select all
emerge -pv @kde-3.5If you do, it's probably a slot issue. Either change the package's slot to the correct one (if you know it) or remove the slot requirement altogether for that package.
Step 4: Finish up
Now all that is left to do is to emerge the set. Since we do not want to reemerge KDE, simply run:
Code: Select all
emerge --noreplace @kde-3.5Code: Select all
emerge -ptuvD worldIf for some reason there's something pulling KDE4 in, you probably missed it. Remove it from world and put it into your set with the appropriate slot dependency, and try again.
Now what?
Now, you can do anything you want without KDE4 getting in. If you decide you want to try KDE4, just emerge it as you would normally. If you just want to take a peek at it, you can emerge kdebase-meta, and that's all you'll get installed! No need to mess with mask files. And once it's time for the old kde to go, you can just unmerge the set and let depclean handle everything else.
If you have any questions, problems or suggestions, please post!
Errata
I confused my /tmp with /var. Wherever I wrote /var/kde-3.5, I meant /tmp/kde-3.5. Sorry about the confusion.
I also forgot to mention that you can delete those files once you're done. (Oct 13, 2008)





