How To Install pygtk2 on Fedora 34

pygtk2 is Python bindings for GTK+

Introduction

In this tutorial we learn how to install pygtk2 on Fedora 34.

What is pygtk2

PyGTK is an extension module for Python that gives you access to the GTK+ widget set. Just about anything you can write in C with GTK+ you can write in Python with PyGTK (within reason), but with all the benefits of using a high-level scripting language.

We can use yum or dnf to install pygtk2 on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install pygtk2.

Install pygtk2 on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install pygtk2 using dnf by running the following command:

sudo dnf -y install pygtk2

Install pygtk2 on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install pygtk2 using yum by running the following command:

sudo yum -y install pygtk2

How To Uninstall pygtk2 on Fedora 34

To uninstall only the pygtk2 package we can use the following command:

sudo dnf remove pygtk2

pygtk2 Package Contents on Fedora 34

/usr/bin/pygtk-demo
/usr/lib/.build-id
/usr/lib/.build-id/0b
/usr/lib/.build-id/0b/6629cd476f9319c20163e0b25cded731e190e5
/usr/lib/.build-id/14
/usr/lib/.build-id/14/4a9fd3f6aa5976adc17e11d15a3070d9a7c022
/usr/lib/.build-id/38
/usr/lib/.build-id/38/b437ab6737a4075073260a6c8b54e1f7fe7c83
/usr/lib/.build-id/a3
/usr/lib/.build-id/a3/aabdd8d7447d90fb926a9f79a506b5c4cb1bbb
/usr/lib/.build-id/cc
/usr/lib/.build-id/cc/cc15136a987cf6a6688832680013c64acec6f9
/usr/lib64/pygtk
/usr/lib64/pygtk/2.0
/usr/lib64/pygtk/2.0/demos
/usr/lib64/pygtk/2.0/demos/__init__.py
/usr/lib64/pygtk/2.0/demos/__init__.pyc
/usr/lib64/pygtk/2.0/demos/__init__.pyo
/usr/lib64/pygtk/2.0/demos/appwindow.py
/usr/lib64/pygtk/2.0/demos/appwindow.pyc
/usr/lib64/pygtk/2.0/demos/appwindow.pyo
/usr/lib64/pygtk/2.0/demos/buttonbox.py
/usr/lib64/pygtk/2.0/demos/buttonbox.pyc
/usr/lib64/pygtk/2.0/demos/buttonbox.pyo
/usr/lib64/pygtk/2.0/demos/changedisplay.py
/usr/lib64/pygtk/2.0/demos/changedisplay.pyc
/usr/lib64/pygtk/2.0/demos/changedisplay.pyo
/usr/lib64/pygtk/2.0/demos/colorsel.py
/usr/lib64/pygtk/2.0/demos/colorsel.pyc
/usr/lib64/pygtk/2.0/demos/colorsel.pyo
/usr/lib64/pygtk/2.0/demos/dialogs.py
/usr/lib64/pygtk/2.0/demos/dialogs.pyc
/usr/lib64/pygtk/2.0/demos/dialogs.pyo
/usr/lib64/pygtk/2.0/demos/dnd.py
/usr/lib64/pygtk/2.0/demos/dnd.pyc
/usr/lib64/pygtk/2.0/demos/dnd.pyo
/usr/lib64/pygtk/2.0/demos/dndpixmap.py
/usr/lib64/pygtk/2.0/demos/dndpixmap.pyc
/usr/lib64/pygtk/2.0/demos/dndpixmap.pyo
/usr/lib64/pygtk/2.0/demos/editable_cells.py
/usr/lib64/pygtk/2.0/demos/editable_cells.pyc
/usr/lib64/pygtk/2.0/demos/editable_cells.pyo
/usr/lib64/pygtk/2.0/demos/entry_completion.py
/usr/lib64/pygtk/2.0/demos/entry_completion.pyc
/usr/lib64/pygtk/2.0/demos/entry_completion.pyo
/usr/lib64/pygtk/2.0/demos/expander.py
/usr/lib64/pygtk/2.0/demos/expander.pyc
/usr/lib64/pygtk/2.0/demos/expander.pyo
/usr/lib64/pygtk/2.0/demos/hypertext.py
/usr/lib64/pygtk/2.0/demos/hypertext.pyc
/usr/lib64/pygtk/2.0/demos/hypertext.pyo
/usr/lib64/pygtk/2.0/demos/images
/usr/lib64/pygtk/2.0/demos/images.py
/usr/lib64/pygtk/2.0/demos/images.pyc
/usr/lib64/pygtk/2.0/demos/images.pyo
/usr/lib64/pygtk/2.0/demos/images/alphatest.png
/usr/lib64/pygtk/2.0/demos/images/apple-red.png
/usr/lib64/pygtk/2.0/demos/images/background.jpg
/usr/lib64/pygtk/2.0/demos/images/floppybuddy.gif
/usr/lib64/pygtk/2.0/demos/images/gnome-applets.png
/usr/lib64/pygtk/2.0/demos/images/gnome-calendar.png
/usr/lib64/pygtk/2.0/demos/images/gnome-foot.png
/usr/lib64/pygtk/2.0/demos/images/gnome-gimp.png
/usr/lib64/pygtk/2.0/demos/images/gnome-gmush.png
/usr/lib64/pygtk/2.0/demos/images/gnome-gsame.png
/usr/lib64/pygtk/2.0/demos/images/gnu-keys.png
/usr/lib64/pygtk/2.0/demos/images/gtk-logo-rgb.gif
/usr/lib64/pygtk/2.0/demos/infobar.py
/usr/lib64/pygtk/2.0/demos/infobar.pyc
/usr/lib64/pygtk/2.0/demos/infobar.pyo
/usr/lib64/pygtk/2.0/demos/list_store.py
/usr/lib64/pygtk/2.0/demos/list_store.pyc
/usr/lib64/pygtk/2.0/demos/list_store.pyo
/usr/lib64/pygtk/2.0/demos/menu.py
/usr/lib64/pygtk/2.0/demos/menu.pyc
/usr/lib64/pygtk/2.0/demos/menu.pyo
/usr/lib64/pygtk/2.0/demos/panes.py
/usr/lib64/pygtk/2.0/demos/panes.pyc
/usr/lib64/pygtk/2.0/demos/panes.pyo
/usr/lib64/pygtk/2.0/demos/pixbufs.py
/usr/lib64/pygtk/2.0/demos/pixbufs.pyc
/usr/lib64/pygtk/2.0/demos/pixbufs.pyo
/usr/lib64/pygtk/2.0/demos/print_editor.py
/usr/lib64/pygtk/2.0/demos/print_editor.pyc
/usr/lib64/pygtk/2.0/demos/print_editor.pyo
/usr/lib64/pygtk/2.0/demos/sizegroup.py
/usr/lib64/pygtk/2.0/demos/sizegroup.pyc
/usr/lib64/pygtk/2.0/demos/sizegroup.pyo
/usr/lib64/pygtk/2.0/demos/statusicon.py
/usr/lib64/pygtk/2.0/demos/statusicon.pyc
/usr/lib64/pygtk/2.0/demos/statusicon.pyo
/usr/lib64/pygtk/2.0/demos/stock_browser.py
/usr/lib64/pygtk/2.0/demos/stock_browser.pyc
/usr/lib64/pygtk/2.0/demos/stock_browser.pyo
/usr/lib64/pygtk/2.0/demos/textscroll.py
/usr/lib64/pygtk/2.0/demos/textscroll.pyc
/usr/lib64/pygtk/2.0/demos/textscroll.pyo
/usr/lib64/pygtk/2.0/demos/textview.py
/usr/lib64/pygtk/2.0/demos/textview.pyc
/usr/lib64/pygtk/2.0/demos/textview.pyo
/usr/lib64/pygtk/2.0/demos/tooltip.py
/usr/lib64/pygtk/2.0/demos/tooltip.pyc
/usr/lib64/pygtk/2.0/demos/tooltip.pyo
/usr/lib64/pygtk/2.0/demos/tree_store.py
/usr/lib64/pygtk/2.0/demos/tree_store.pyc
/usr/lib64/pygtk/2.0/demos/tree_store.pyo
/usr/lib64/pygtk/2.0/demos/treemodel.py
/usr/lib64/pygtk/2.0/demos/treemodel.pyc
/usr/lib64/pygtk/2.0/demos/treemodel.pyo
/usr/lib64/pygtk/2.0/demos/ui_manager.py
/usr/lib64/pygtk/2.0/demos/ui_manager.pyc
/usr/lib64/pygtk/2.0/demos/ui_manager.pyo
/usr/lib64/pygtk/2.0/pygtk-demo.py
/usr/lib64/pygtk/2.0/pygtk-demo.pyc
/usr/lib64/pygtk/2.0/pygtk-demo.pyo
/usr/lib64/python2.7/site-packages/gtk-2.0
/usr/lib64/python2.7/site-packages/gtk-2.0/atk.so
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.pyc
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.pyo
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/_gtk.so
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/_lazyutils.py
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/_lazyutils.pyc
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/_lazyutils.pyo
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/compat.py
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/compat.pyc
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/compat.pyo
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/deprecation.py
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/deprecation.pyc
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/deprecation.pyo
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/keysyms.py
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/keysyms.pyc
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/keysyms.pyo
/usr/lib64/python2.7/site-packages/gtk-2.0/gtkunixprint.so
/usr/lib64/python2.7/site-packages/gtk-2.0/pango.so
/usr/lib64/python2.7/site-packages/gtk-2.0/pangocairo.so
/usr/share/doc/pygtk2
/usr/share/doc/pygtk2/AUTHORS
/usr/share/doc/pygtk2/MAPPING
/usr/share/doc/pygtk2/NEWS
/usr/share/doc/pygtk2/README
/usr/share/licenses/pygtk2
/usr/share/licenses/pygtk2/COPYING

References

Summary

In this tutorial we learn how to install pygtk2 on Fedora 34 using yum and dnf.