Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO Prevent KDE4 packages from installing, without masking
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Oct 13, 2008 3:24 am    Post subject: HOWTO Prevent KDE4 packages from installing, without masking Reply with quote

What is this about?

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:
Code:
cat /tmp/kde-3.5 | while read line; do
     echo "$line:3.5" >> /etc/portage/sets/kde-3.5;
done

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".
Code:
cat /tmp/kde-extras | while read line; do
     echo "$line:0" >> /etc/portage/sets/kde-3.5;
done


Step 3: Make sure your set works

Let's try it out:
Code:
emerge -pv @kde-3.5

If you get no errors, you may skip to the next step.

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
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Mon Oct 13, 2008 3:35 am    Post subject: Reply with quote

I will test that in a near future :P

Thanks for this info.
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
rjw8703
Apprentice
Apprentice


Joined: 14 Aug 2004
Posts: 246
Location: Auburn, Al

PostPosted: Mon Oct 13, 2008 5:17 am    Post subject: Reply with quote

I have no directory called /var/kde-3.5

What should I do?
Back to top
View user's profile Send private message
Geralt
Apprentice
Apprentice


Joined: 14 Jun 2008
Posts: 150

PostPosted: Mon Oct 13, 2008 5:51 am    Post subject: Reply with quote

rjw8703 wrote:
I have no directory called /var/kde-3.5

What should I do?

What do you mean by this? There should be no /var/kde-3.5 directory, unless you create it of course.
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1156
Location: Austria

PostPosted: Mon Oct 13, 2008 6:57 am    Post subject: Reply with quote

Code:
cat /var/kde-3.5 | while read line; do
      echo "$line:3.5" >> /etc/portage/sets/kde-3.5;
 done

gives
Code:
cat: /var/kde-3.5: No such file or directory

_________________
Blog | btrfs | Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
Geralt
Apprentice
Apprentice


Joined: 14 Jun 2008
Posts: 150

PostPosted: Mon Oct 13, 2008 7:04 am    Post subject: Reply with quote

ToeiRei wrote:
Code:
cat /var/kde-3.5 | while read line; do
      echo "$line:3.5" >> /etc/portage/sets/kde-3.5;
 done

gives
Code:
cat: /var/kde-3.5: No such file or directory

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).
Back to top
View user's profile Send private message
michel7
Guru
Guru


Joined: 04 May 2006
Posts: 461
Location: localhost

PostPosted: Mon Oct 13, 2008 10:56 am    Post subject: Reply with quote

well, i expect some troubles with updating kde if kde3-5 updates will be released in the near feature
_________________
Software is like sex. It's better when it's free
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Mon Oct 13, 2008 1:40 pm    Post subject: Reply with quote

I tried it and it left severeal (6 or7) packages that needed to be masked. It's not a catchall.
http://forums.gentoo.org/viewtopic-t-708282.html wrote:
KDE 4.1 in Portage - FAQ

Q: Why there are no sets for KDE 4.1?

A: KDE-4.1.2 so far is NOT making use of sets but sets are expected to arrive in near future - the reason is - the naming convention for sets is not yet established.
Back to top
View user's profile Send private message
rjw8703
Apprentice
Apprentice


Joined: 14 Aug 2004
Posts: 246
Location: Auburn, Al

PostPosted: Mon Oct 13, 2008 2:14 pm    Post subject: Reply with quote

I've found that putting these packages in package.mask works better:

>=kde-base/kdelibs-4.0.0
>=kde-base/kdesu-4.0.0
>=kde-base/kdebase-meta-4.0.0
>=kde-base/kde-meta-4.0.0

These 4 packages stopped all kde-4 from being installed. This isn't much.
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Mon Oct 13, 2008 5:53 pm    Post subject: Reply with quote

On my box I only need this line in package.mask to prevent the installation of all of KDE-4
Code:
>media-sound/amarok-1.4.10-r1

And this line in /var/lib/portage/world
Code:
kde-base/kde-meta:3.5
8)
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Oct 13, 2008 6:27 pm    Post subject: Reply with quote

Geralt wrote:
ToeiRei wrote:
Code:
cat /var/kde-3.5 | while read line; do
      echo "$line:3.5" >> /etc/portage/sets/kde-3.5;
 done

gives
Code:
cat: /var/kde-3.5: No such file or directory

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. :oops:
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Oct 13, 2008 6:40 pm    Post subject: Reply with quote

michel7 wrote:
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 :wink:
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Mon Oct 13, 2008 9:37 pm    Post subject: Reply with quote

AM088 wrote:
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?

Certainly
Code:
# grep kde /var/lib/portage/world
# grep kde /var/lib/portage/world_sets
@kde-3.5
# grep kde /etc/portage/sets/kde-3.5
kde-base/kde-meta:3.5
# grep kde /etc/portage/package.mask
# emerge -uDNpv @system @world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-cpp/clucene-0.9.20  USE="-debug -doc -threads" 1,513 kB
[ebuild  N    ] kde-base/automoc-0.9.84  8 kB
[ebuild  N    ] kde-base/qimageblitz-0.0.4  USE="3dnow mmx (-altivec) -debug -sse -sse2" 55 kB
[ebuild  N    ] media-sound/phonon-4.2.0  USE="gstreamer -debug" 392 kB
[ebuild  N    ] dev-util/boost-build-1.35.0-r1  USE="python -examples" 22,868 kB
[ebuild  N    ] dev-libs/boost-1.35.0-r2  USE="-debug -doc -expat -icu -mpi -tools" 5 kB
[ebuild  N    ] app-misc/strigi-0.5.11  USE="clucene dbus fam qt4 -debug -exif -hyperestraier -inotify -log -test" 857 kB
[ebuild  N    ] media-libs/raptor-1.4.18  USE="curl unicode xml" 1,619 kB
[ebuild  N    ] app-office/akonadi-server-1.0.0  USE="-mysql" 120 kB
[ebuild  N    ] dev-libs/soprano-2.1  USE="clucene sesame2 -debug -doc -redland" 1,789 kB
[ebuild  NS   ] kde-base/kdelibs-4.1.2-r1 [3.5.10-r2] USE="3dnow acl alsa bzip2 fam kerberos mmx nls opengl semantic-desktop spell ssl (-altivec) -bindist -debug -doc -htmlhandbook -jpeg2k -kdeprefix -openexr -sse -sse2 -test -zeroconf" 8,899 kB
[ebuild  N    ] kde-base/kdepimlibs-4.1.2  USE="ldap sasl -debug -htmlhandbook -kdeprefix -test" 1,844 kB
[ebuild  N    ] kde-base/libtaskmanager-4.1.2  USE="xcomposite -debug -kdeprefix" 46,387 kB
[ebuild  N    ] kde-base/libkworkspace-4.1.2  USE="-debug -kdeprefix" 0 kB
[ebuild  N    ] kde-base/libplasma-4.1.2  USE="opengl -debug -kdeprefix -test -xinerama" 0 kB
[ebuild  NS   ] media-sound/amarok-1.90-r1 [1.4.10-r1] USE="opengl -cdaudio -daap -debug -ifp -ipod -kdeprefix -mp3tunes -mp4 -mtp -mysql -njb -visualization" 3,306 kB

Total: 16 packages (14 new, 2 in new slots), Size of downloads: 89,657 kB

Of course I could mask all the rest, but the other way is easier
Code:
# grep kde /var/lib/portage/world
kde-base/kde-meta:3.5
# grep amarok /etc/portage/package.mask
>media-sound/amarok-1.4.10-r1
# emerge -uDNpv @system @world

These are the packages that would be merged, in order:

Calculating dependencies... done!

Total: 0 packages, Size of downloads: 0 kB
:P
Back to top
View user's profile Send private message
Edweirdo
Guru
Guru


Joined: 28 Jan 2003
Posts: 348
Location: Boston, Mass, USA

PostPosted: Tue Oct 14, 2008 4:44 pm    Post subject: Reply with quote

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 }.
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Tue Oct 14, 2008 8:16 pm    Post subject: Reply with quote

This should work (unless KDE-4 completely changed how kdm works)
Code:
# cat /usr/share/xsessions/kde-3.5.desktop
[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=/usr/kde/3.5/bin/startkde
TryExec=/usr/kde/3.5/bin/startkde
Name=KDE 3.5
Back to top
View user's profile Send private message
Edweirdo
Guru
Guru


Joined: 28 Jan 2003
Posts: 348
Location: Boston, Mass, USA

PostPosted: Tue Oct 14, 2008 10:04 pm    Post subject: Reply with quote

notHerbert

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 }.
Back to top
View user's profile Send private message
Edweirdo
Guru
Guru


Joined: 28 Jan 2003
Posts: 348
Location: Boston, Mass, USA

PostPosted: Tue Oct 14, 2008 10:11 pm    Post subject: Reply with quote

I resynced today and it now allows me to have both kdestart-3.5 and kdestart-4.1. Once I emerged kdestart-3.5 the kde-3.5 showed up in the session list.

Thanks for the help.
_________________
Life is too short and too important to { take seriously | use Windows }.
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Wed Oct 15, 2008 12:00 am    Post subject: Reply with quote

No problem :P
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1056
Location: /dev/koelsch

PostPosted: Thu Oct 16, 2008 6:36 pm    Post subject: AM088's Procedure does not work for me... Reply with quote

Hi AM088,

i've tried out your procedure until i came to the step:
Code:
emerge -ptuvD world

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.
Code:

>=kde-base/kdelibs-4.0.0
>=kde-base/kdesu-4.0.0
>=kde-base/kdebase-meta-4.0.0
>=kde-base/kde-meta-4.0.0
>=media-sound/amarok-1.90
>=kde-base/kopete-4.0.0


So it seems not to work under all conditions for me. One important hint for some others, when doing:
Code:
cat /tmp/kde-3.5 | while read line; do echo "$line:3.5" >> /etc/portage/sets/kde-3.5; done
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!
Back to top
View user's profile Send private message
Smart1
n00b
n00b


Joined: 16 May 2007
Posts: 66

PostPosted: Fri Nov 14, 2008 7:25 pm    Post subject: Reply with quote

I have make all of this but

emerge -a kdelibs

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild NS ] kde-base/kdelibs-4.1.3-r1 [3.5.10-r2] USE="3dnow acl alsa bzip2 fam jpeg2k kerberos mmx nls opengl semantic-desktop spell sse sse2 ssl (-altivec) -bindist -debug -doc -htmlhandbook -kdeprefix -openexr -test -zeroconf"

Would you like to merge these packages? [Yes/No] n

emerge -ptuvD world

These are the packages that would be merged, in reverse order:

Calculating dependencies \--- WARNING: Package 'dev-java/gnu-crypto-2.1.0' uses '-*' keyword.
--- WARNING: Package 'dev-java/gnu-crypto-2.1.0' uses '-*' keyword.
--- WARNING: Package 'dev-java/gnu-crypto-2.1.0' uses '-*' keyword.
... done!

!!! 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])

I wish to remove KDE 4 and only use KDE 3.5

notHerbert wrote at

http://forums.gentoo.org/viewtopic-t-714854.html?sid=965f629f2164e76abb3747f7120f24cc

There is a thread here about preventing KDE4 from being installed.

To remove kde4 this should work fine
Code:
emerge -Ca $(qlist -IC | grep "kde.*4.1" | sed 's/^/=/' | tr '\n' ' ')
emerge --depclean -av
revdep-rebuild -- --ask


emerge -Ca $(qlist -IC | grep "kde.*4.1" | sed 's/^/=/' | tr '\n' ' ')

emerge unmerge can only be used with specific package names
_________________
http://www.gentoo.org/ http://www.sysresccd.org/ http://www.linuxquestions.org/

Registered Linux user: #130654 http://counter.li.org
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Mon Nov 17, 2008 4:41 pm    Post subject: Reply with quote

There was a follow up post where I corrected the command to remove KDE4

I had forgotten to add the v option in qlist -IC so the correct command is
Code:
emerge -Ca $(qlist -ICv | grep "kde.*4.1" | sed 's/^/=/' | tr '\n' ' ')


:P 8)
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1741
Location: Mannheim, Germany

PostPosted: Fri Aug 07, 2009 5:49 pm    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
freifunk_connewitz
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2006
Posts: 120

PostPosted: Mon Oct 26, 2009 6:50 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum