Search:  
Gentoo Wiki

HOWTO_Get_rid_of_GTK_1.x

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Nowadays, GTK+-1.x is not really required anymore to run an decent desktop. Despite that, because of a few packages which have not yet switched to 2.x, most users still get it installed. In this page, we will try to keep a list of those package which you should avoid or mark -gtk in your /etc/portage/package.use if you want to stay away from this deprecated toolkit.

Wikipedia has an article on:
GTK

Contents

The tedious instructions

This section describes how to get rid of GTK+-1.x on your system. Although this HOWTO focuses on how to keep GTK+-1.x off of your system, the method described is easily applied to any other package(s) that you want to get rid of.

In the following HOWTO we assume that the user has both gtk and gtk2 set in his global USE flags. In other words, this HOWTO assumes that GTK+-1.x is currently installed on your system. However, if this is not the case, then the following steps will still prevent GTK+-1.x from being installed, your task will just be easier.

The first step is to mask GTK+-1.x on your system. Edit /etc/portage/package.mask and add the following lines:

 <x11-libs/gtk+-1
 <dev-libs/glib-1
 

Now, we will track down the packages which depend on this library. Type the following command:

 # emerge -pe world
 

If any package depends on GTK+-1.x (or its GLib), emerge will give you an error message similar to the following:

 !!! All ebuilds that could satisfy "=x11-libs/gtk+-1.2*" have been masked.
 !!! One of the following masked packages is required to complete your request:
 - x11-libs/gtk+-1.2.10-r10 (masked by: package.mask)
 - x11-libs/gtk+-1.2.10-r11 (masked by: package.mask)
 
 For more information, see MASKED PACKAGES section in the emerge man page or
 section 2.2 "Software Availability" in the Gentoo Handbook.
 !!!    (dependency required by "net-analyzer/nmap-3.93" [ebuild])
 

So, net-analyser/nmap depends on GTK+-1.x: it's time to see whether this is an hard dependency or an optional dependency:

 # equery uses net-analyzer/nmap
 [ Searching for packages matching net-analyzer/nmap... ]
 [ Colour Code : set unset ]
 [ Legend      : Left column  (U) - USE flags from make.conf              ]
 [             : Right column (I) - USE flags packages was installed with ]
 [ Found these USE variables for net-analyzer/nmap-3.93 ]
  U I
  + + gtk : Adds support for x11-libs/gtk+ (The GIMP Toolkit)
  + + ssl : Adds support for Secure Socket Layer connections
 

Here we are lucky; GTK+ support seems to be optional (controlled by a USE flag). We can disable the gtk flag for this package, thanks to /etc/portage/package.use, and then go back to emerge to see what will be the next bugger:

 # echo "net-analyzer/nmap  -gtk" >> /etc/portage/package.use
 # emerge -pe world
 
 These are the packages that I would merge, in order:
 
 Calculating world dependencies \
 !!! All ebuilds that could satisfy "=x11-libs/gtk+-1.2*" have been masked.
 !!! One of the following masked packages is required to complete your request:
 - x11-libs/gtk+-1.2.10-r10 (masked by: package.mask)
 - x11-libs/gtk+-1.2.10-r11 (masked by: package.mask)
 
 For more information, see MASKED PACKAGES section in the emerge man page or
 section 2.2 "Software Availability" in the Gentoo Handbook.
 !!!    (dependency required by "www-client/dillo-0.8.5-r1" [ebuild])
 

So, now we have an issue with www-client/dillo. Again, we check whether its GTK+-1.x dependency is optional:

 # equery uses www-client/dillo
 [ Searching for packages matching dillo... ]
 [ Colour Code : set unset ]
 [ Legend      : Left column  (U) - USE flags from make.conf              ]
 [             : Right column (I) - USE flags packages was installed with ]
 [ Found these USE variables for www-client/dillo-0.8.5-r1 ]
  U I
  + + nls      : <unknown>
  + + truetype : Adds support for FreeType and/or FreeType2 fonts
  + + ipv6     : Adds support for IP version 6
  + + ssl      : Adds support for Secure Socket Layer connections
 

Obviously, there is no way to remove Dillo's dependency on GTK+-1.x. But the world is full of other nice web browsers, we can probably live without this one (check, i.e., links, which can be used in X and display images). So we will apply the same method we used for GTK+-1.x: mask it and ensure that no other package depends on it. We will remove it at the last step, just in case there is something depending on GTK+-1.x we cannot live without, we would revert the following changes without the need of unmerging/reemerging. Also note that a newer (masked) version may be available, that depends on GTK2, so a

 # ACCEPT_KEYWORDS="~x86" emerge -p www-client/dillo
 

is recommended. However, it is not the case here. If it were (let us take easytag for example)

 # ACCEPT_KEYWORDS="~x86" emerge -p media-sound/easytag
 # echo 'media-sound/easytag' >> /etc/portage/package.keywords
 # emerge -au media-sound/easytag
 

and skip the next few paragraphs.

We must also remove it from our world file:

 # sed -i '\:^www-client/dillo$:d' /var/lib/portage/world
 # echo "www-client/dillo" >> /etc/portage/package.mask
 # emerge -pe world

 These are the packages that I would merge, in order:
 
 Calculating world dependencies \
 !!! All ebuilds that could satisfy "www-client/dillo" have been masked.
 !!! One of the following masked packages is required to complete your request:
 - www-client/dillo-0.8.4-r1 (masked by: package.mask)
 - www-client/dillo-0.7.3-r7 (masked by: package.mask)
 - www-client/dillo-0.8.4-r2 (masked by: package.mask)
 - www-client/dillo-0.8.5 (masked by: package.mask)
 - www-client/dillo-0.8.5-r1 (masked by: package.mask)
 
 For more information, see MASKED PACKAGES section in the emerge man page or
 section 2.2 "Software Availability" in the Gentoo Handbook.
 !!!    (dependency required by "mail-client/sylpheed-claws-1.9.14" [ebuild])
 

Oh oh, seems like having masked Dillo now gives us more trouble... Let's see if that dependency is optional:

 # equery uses mail-client/sylpheed-claws
 ...
  + + dillo        : Enables support for inline http email viewing with a plugin (which depends on the dillo browser)
 ...
 

Ok, so it is optional. We can now disable the dillo flag for mail-client/sylpheed-claws in /etc/portage/package.use, and continue our quest for packages depending (directly or not) on GTK+-1.x. This process may take quite some time if you have many packages installed. To speed up the process we provide you with some ready-to-use /etc/portage/package.mask and /etc/portage/package.use files in the following, so that you don't have to do this search by yourself.

We continue this process until emerge -pe world produces no errors. At this point we rebuild all the packages for which the USE flags have been changed and then unmerge all the packages that we have masked:

 # emerge --ask --newuse world
 # emerge --ask -C "<x11-libs/gtk+-2" "<dev-libs/glib-2" www-client/dillo ...
 

From here, your system should be free of GTK-1.x. However, you may want to execute emerge depclean though (do it with care, as usual), as a final check to get rid of any remaining GTK+-1.x dependencies followed by revdep-rebuild to ensure we have not broken any hidden runtime dependencies:

# emerge --ask depclean
# revdep-rebuild -p
Note: Note that GTK is a slotted package and will not appear in emerge --depclean. One can use edcatmur's dep unsupported program for removing slotted packages.

package.mask

This is an /etc/portage/package.mask which hides various packages related to GTK+-1.x or having hard dependencies on it. Sure, it may be incomplete or lying for a few packages, so please people, don't hesitate to edit this page to make it better.

 # Main anti-gtk1 mask:
 <dev-cpp/gtkmm-2
 <dev-libs/glib-2
 media-libs/gdk-pixbuf
 <x11-libs/gtk+-2
 
 # Random packages you won't be able to merge
 # without glib1, gtk1 or gdk-pixbuf:
 app-admin/gps
 app-admin/gpsui
 app-admin/pcihpview
 app-admin/xsu
 app-arch/guitar
 app-cdr/gcombust
 app-cdr/gtoaster
 app-cdr/simplecdrx
 app-crypt/quintuple-agent
 app-dicts/babytrans
 app-editors/beaver
 <app-editors/ghex-2
 app-editors/gnotepad+
 app-emulation/libspectrum
 <app-emulation/vmware-workstation-4
 app-emulation/xwine
 app-i18n/jmode
 <app-i18n/kanjipad-2
 <app-laptop/gtkpbbuttons-0.6
 app-misc/endeavour
 app-misc/gato
 app-misc/gentoo
 app-misc/gfontview
 <app-misc/gpsdrive-2
 app-misc/gtktalog
 app-misc/ithought
 app-misc/mtoolsfm
 app-misc/rio500
 app-misc/sjog
 app-mobilephone/gscmxx
 app-mobilephone/gtkesms
 app-office/gbib
 app-office/gnucash
 app-office/lahelper
 <app-office/mdbtools-0.5
 <app-office/ooodi-0.68
 app-text/gsview
 <app-text/gtranslator-1
 app-text/manedit
 app-text/tex-guy
 dev-lang/lazarus
 dev-libs/libstroke
 <dev-ml/lablgtk-2
 dev-perl/gtk-perl
 dev-perl/gtk-perl-glade
 dev-php/php-gtk
 dev-php4/php-gtk
 dev-python/bonobo-python
 <dev-python/gnome-python-1.99
 <dev-python/orbit-python-1.99
 <dev-python/pygtk-2
 dev-python/python-gtkextra
 dev-python/visual
 dev-ruby/ruby-gconf
 dev-ruby/ruby-gdkimlib
 dev-ruby/ruby-gtk
 dev-ruby/ruby-libglade
 dev-util/gcvs
 <dev-util/gob-2
 <dev-util/glade-2
 <dev-util/glademm-2
 dev-util/sashxb
 <dev-util/screem-0.6
 dev-util/glimmer
 games-action/bombermaze
 games-board/eboard
 games-board/gnono
 games-board/mah-jong
 games-emulation/epsxe
 games-emulation/gnomame
 games-emulation/grustibus
 <games-puzzle/mindless-1.6
 games-emulation/gtuxnes
 games-emulation/infones
 games-emulation/pcsx2
 games-emulation/ps2emu-cddvdlinuz
 games-emulation/ps2emu-cdvdiso
 games-emulation/ps2emu-dev9null
 games-emulation/ps2emu-gssoft
 games-emulation/ps2emu-padxwin
 games-emulation/ps2emu-spu2null
 games-emulation/ps2emu-usbnull
 games-emulation/psemu-cdriso
 games-emulation/psemu-padjoy
 games-emulation/psemu-padxwin
 games-emulation/psemu-peopssoftgpu
 games-emulation/psemu-peopsspu
 games-fps/vendetta-online-bin
 games-kids/gtans
 games-kids/matritsa
 games-kids/stickers
 games-misc/groach
 games-misc/gtklife
 games-mud/gMOO
 games-puzzle/codebreaker
 games-puzzle/glickomania
 >=games-rpg/vegastrike-0.4
 games-simulation/cannonsmash
 games-simulation/corewars
 games-strategy/xarchon
 kde-base/dcopc
 kde-base/xparts
 <mail-client/balsa-2
 <mail-client/evolution-2
 mail-client/gbuffy
 mail-client/spruce
 media-gfx/autotrace
 media-gfx/danpei
 <media-libs/imlib-1.9.15
 media-libs/libmovtar
 media-libs/openquicktime
 media-radio/ssbd
 media-radio/xconvers
 media-sound/demolition
 media-sound/digitaldj
 <media-sound/galan-0.2.99
 media-sound/smurf
 media-sound/soundtracker
 media-sound/swami
 net-analyzer/cheops-ng
 <net-analyzer/etherape-0.9
 net-analyzer/mbrowse
 net-analyzer/nomad
 net-analyzer/scli
 net-analyzer/traffic-vis
 net-analyzer/xtraceroute
 net-dialup/gcdial
 net-dialup/xlc
 net-dns/dnsquery
 <net-libs/libfwbuilder-2
 net-libs/soup
 <net-firewall/fwbuilder-2
 net-firewall/gtk-iptables
 net-ftp/deadftp
 net-im/aim
 net-im/ayttm
 net-im/everybuddy
 net-im/gnophone
 net-im/ickle
 net-im/silc-client
 net-im/ymessenger
 <net-irc/xchat-2
 <net-misc/aria-1
 net-misc/bidwatcher
 net-misc/cisco-aironet-client-utils
 net-misc/gtkesms
 net-misc/gtm
 net-misc/LinNeighborhood
 net-misc/sambasentinel
 net-misc/xfsamba
 net-p2p/dctc
 <net-nds/gq-0.99
 net-p2p/fidelio
 net-p2p/gnapster
 <net-p2p/gnunet-0.6
 net-p2p/gtkhx
 net-p2p/lopster
 net-p2p/napshare
 <net-print/gtklp-1
 net-print/pup
 <net-wireless/airsnort-0.2.3
 <net-wireless/bluez-hciemu-1.2
 net-wireless/gtkskan
 net-wireless/irda-utils
 net-www/bk_edit
 sci-calculators/snac
 <=sci-chemistry/chemtool-1.6.3
 <sci-chemistry/gperiodic-2
 sci-electronics/geda
 sci-electronics/gerbv
 sci-electronics/gtkwave
 sci-electronics/gwave
 <sci-electronics/oregano-0.40
 sci-mathematics/euler
 sci-misc/oww
 sys-apps/gscanbus
 sys-cluster/heartbeat
 <sys-libs/pam-0.78
 www-client/ci
 www-client/dillo
 www-client/gorua
 x11-libs/buffy
 x11-libs/gtkDPS
 x11-libs/gtk+extra
 <x11-libs/gtkglarea-1.99
 x11-libs/guile-gtk
 <x11-libs/rep-gtk-0.17
 x11-misc/bbrb
 <x11-misc/bbrun-1.6
 x11-misc/e16keyedit
 x11-misc/e16menuedit
 <x11-themes/gtk-engines-2
 x11-themes/gtk-engines-begtk
 <x11-themes/gtk-engines-cleanice-1.2
 x11-themes/gtk-engines-eazel
 <x11-themes/gtk-engines-flat-2
 x11-themes/gtk-engines-gtkstep
 x11-themes/gtk-engines-icegradient
 x11-themes/gtk-engines-industrial
 <x11-themes/gtk-engines-lighthouseblue-0.7
 x11-themes/gtk-engines-mac2
 <x11-themes/gtk-engines-metal-1.9
 x11-themes/gtk-engines-mist
 x11-themes/gtk-engines-notif
 x11-themes/gtk-engines-notif2
 x11-themes/gtk-engines-pixmap
 x11-themes/gtk-engines-raleigh
 <x11-themes/gtk-engines-redmond95-1.9
 x11-themes/gtk-engines-smooth
 <x11-themes/gtk-engines-thinice-2
 x11-themes/gtk-engines-xenophilia
 <x11-themes/gtk-theme-switch-1.9
 x11-themes/mandrake-artwork
 x11-themes/qtpixmap
 <x11-themes/ximian-artwork-0.2.32
 <x11-wm/sawfish-1.3
 <x11-wm/selectwm-0.4
 
 # Actually masked for x86 only, probably fine on other arches:
 www-client/mozilla-bin
 # Ebuild with wrong deps on glib1 or gdk-pixbuf.
 # Watch them, they may get fixed:
 app-admin/gkrellm
 dev-embedded/gnusim8085
 

package.use

And now, here is an /etc/portage/package.use which should disable most GTK+-1.x dependencies where they are optional. Again, feel free to edit it when you find missing or wrong entries. With the current portage version you can make /etc/portage/package.use into a directory, and within it a file called gtk1, where you can put the the lines below and keep them separated from your other use flags.

 app-admin/powertweak                -gtk
 app-laptop/toshiba-utils            -gtk
 app-misc/twin                       -gtk
 dev-db/edb                          -gtk
 dev-lang/pike                       -gtk
 dev-lang/gwydion-dylan              -gtk
 dev-util/pilrc                      -gtk
 games-emulation/darcnes             -gtk
 games-emulation/generator           -gtk
 games-roguelike/angband             -gtk
 games-roguelike/zangband            -gtk
 games-strategy/xscorch              -gtk
 media-gfx/surf                      -gtk
 media-libs/imlib                    -gtk
 media-libs/libjsw                   -gtk
 media-libs/yiff                     -gtk
 media-video/tuxzap-programs         -gtk
 net-analyzer/hydra                  -gtk
 net-misc/asterisk                   -gtk
 net-misc/ipsorcery                  -gtk
 sci-astronomy/predict               -gtk
 sys-fs/evms                         -gtk
 x11-wm/fvwm                         -gtk
 

The straightforward instructions

Checking you really want to do it

First step is to check whether you really can live without GTK+-1.x. Copy the above package.mask to a temporary file, let's say /tmp/nogtk1.mask, and check output of the following command:

 # emerge -pC $(sed '/^[[:blank:]]*#/d' /tmp/nogtk1.mask)
 

It should list packages which have to be uninstalled. Read that list carefully, and if you see any application you can't live without, then forget about uninstalling GTK+-1.x.

Alternatively, check the output of the following commands:

 # revdep-rebuild --library=/usr/lib/libgtk-1.2.so.0 -pv
 # revdep-rebuild --library=/usr/lib/libglib-1.2.so.0 -pv
 

Fixing packages USE flags

Second step is to fix your global and local USE flags, and to rebuild packages for which they have change:

 # emerge -v --ask --newuse world
 

Unmerging obsolete packages

Third step is to actually cleanup your system of all GTK+-1.x related packages:

 # emerge --ask -C $(sed '/^[[:blank:]]*#/d' /tmp/nogtk1.mask)
 

Checking your system is consistent

Last step is to check that everything went fine:

 # emerge -pe world
 

In case there are errors here because of dependencies on some masked packages, then it means that the above package.mask or package.use still have some mistakes or are incomplete. See the tedious instructions for how to track the problem and fix it. And please fix this page too while you're at it.

Finally, once emerge -pe world is happy, you can try a revdep-rebuild (you already have app-portage/gentoolkit installed, don't you?), to be sure that there are no hidden broken dependencies:

# revdep-rebuild -p

Optional: cleanup package.*

It is safe to keep all the noise you've added to your package.mask or package.use, but if you really want, you can have fun cleaning them up:

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Get_rid_of_GTK_1.x"

Last modified: Sat, 19 Jul 2008 07:21:00 +0000 Hits: 19,952