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:

cp /var/lib/portage/world /root/world

Now, create a new, temporary file file somewhere: We'll refer to it as /tmp/kde-3.5. Now, cut and paste anything starting with "kde-base/" into it. Next, scan through the rest of the world file and move anything else that's KDE3-related (including anything in kde-misc) into a different file, /tmp/kde-extras.

Step 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:

mkdir -p /etc/portage/sets/

before putting it in a set we need to indicate that all these packages should be from KDE 3.5. The best way to do this is by specifying the slot they're in since all KDE3 packages are in the "3.5" slot. So all you have to do now is to append ":3.5" after the package name. Let's use bash to help us with this:

You can just paste the above into the terminal, or type it in in one line, if you want. Now do the same thing for the kde-optional file we created, except that those files have slot "0" instead of "3.5". All the new KDE4 programs introduced are in the slot "4.1".

If 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:

emerge --noreplace @kde-3.5

Now, let's try it out:

Code:

emerge -ptuvD world

You should now only get updates to packages unrelated to KDE. If you do, then you're done! You may now delete /tmp/kde-4.1 and /var/kde-extras.

If 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)_________________“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010

Last edited by Etal on Mon Oct 13, 2008 6:24 pm; edited 3 times in total

This seems to be a typo, it should be /tmp/kde-3.5 or wherever you stored kde-3.5 (I don't think /tmp is a good idea).

You're correct, I confused the /tmp with /var. Sorry about that. _________________“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010

well, i expect some troubles with updating kde if kde3-5 updates will be released in the near feature

From what I know, there will never be a KDE 3.6, so since we did this by the "3.5" slot, there will be no problems with updates.

notHerbert wrote:

I tried it and it left severeal (6 or7) packages that needed to be masked. It's not a catchall.

Could you share which packages gave problems?

rjw8703 wrote:

These 4 packages stopped all kde-4 from being installed. This isn't much.

Maybe for you it's 4 packages, but for me it's 37 _________________“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010

I installed kde4 and like it but it has some problems with my multiple monitors. I want to be able to start kde3 now with kde4 still installed. I can't find the information on how to do that. kdm has a kde-4 but not kde-3 selection to log in from.

I'd like to be able to choose between the two.

Any help would be appreciated._________________Life is too short and too important to { take seriously | use Windows }.

That sounds reasonable, except startkde is gone becuase there was a conflict between 3.5 and 4.1 so it uninstalled startkde. That could cause me issues trying to switch between the two._________________Life is too short and too important to { take seriously | use Windows }.

Now emerge tells me one blocked package cause circular dependeny. It was kde-base/kdebase-startkde-3.5.10-r2 and r3, pulled by differnt packages i coudn't name now exactly, cause i went on, trying to solve this, maybe not in a clever way.
As far as i remember, i cleared the kdebase-startkde and reinstalled it without saying explizit the version. So portage installed version 4.1.2-r1 with all the other new depending packages.
Next time i do the pretend option at first - ok.

So ich changed my strategy and masked the packages too, as some others did.
But i had to mask the following packages to get success.

you have to delete the maybe doubled :3.5 lines, cause some packages just contain this information. E.g. in my case the kde-base/kdemultimedia-arts:3.5 into the world file.

P.S. I tried the KDE 4.1.2 Desktop for three days, but went back today, cause to much pain and confusion and malfunctions.
Give it a try when its as stable and intuitive as the testing KDE-3.5 Version - my opinion, Andy._________________If you want to see a Distro done right, compile it yourself!

!!! Ebuilds for the following packages are either all
!!! masked or don't exist:
kde-base/kde-meta:3.5:3.5

!!! All ebuilds that could satisfy ">=kde-base/kdesu-4.1.3:4.1" have been masked.
!!! One of the following masked packages is required to complete your request:
- kde-base/kdesu-4.1.3 (masked by: package.mask)

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.
(dependency required by "kde-base/kdebase-kioslaves-4.1.3" [ebuild])
(dependency required by "@world" [argument])

Just stumbled upon this due to kde-4.3 masking madness.
Thanks to the OP!_________________"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"

since the portage maintainers have removed the functionality of user defined sets from portage, the HOWTO doesn't work with the current emerge command. but for me it worked by extracting the kde-lines from the world file like OP wrote, then appending to all of them the suggested :3.5 or :0 slot definitions and then pasting them back to the world file.
by doing so, I was able to update world without kde-3.5.10 being "updated" to kde4.

(surely - this is nothing to live with very long if upstream really has stopped maintaining kde-3.5. but I've read somewhere (wikipedia I think) that it will be updated for a further while because quite a few administration and public service offices rely on it).