2022-11-21 14:48:20 +01:00
Up: [README.md ](../README.md ), Prev: [Section 1 ](sec1.md ), Next: [Section 3 ](sec3.md )
2021-01-11 03:15:04 +01:00
2022-11-21 14:48:20 +01:00
# Installing GTK 4 into Linux distributions
2020-12-21 13:12:05 +01:00
2022-11-21 14:48:20 +01:00
This section describes how to install GTK 4 into Linux distributions.
2020-12-22 03:30:06 +01:00
2022-12-21 14:31:33 +01:00
There are two ways to install GTK 4.
2021-04-26 04:44:35 +02:00
2021-05-09 07:01:31 +02:00
- Install it from the distribution packages.
2022-12-21 14:31:33 +01:00
- Build it from the source files.
2021-06-13 05:03:36 +02:00
## Installation from the distribution packages
2021-04-26 04:44:35 +02:00
2022-12-21 14:31:33 +01:00
The first way is the best and easiest way to install it.
I've installed GTK 4 packages (version 4.8.1) in Ubuntu 22.10.
2021-04-26 04:44:35 +02:00
2021-05-09 07:01:31 +02:00
~~~
2022-12-21 14:31:33 +01:00
$ sudo apt install libgtk-4-dev
2021-05-09 07:01:31 +02:00
~~~
2021-04-26 04:44:35 +02:00
2022-12-21 14:31:33 +01:00
It is important to install the developing package (libgtk-4-dev).
It includes C header files.
Otherwise, you can't compile any GTK 4 based programs.
2022-04-27 04:00:24 +02:00
2022-12-21 14:31:33 +01:00
Fedora, Debian, Arch, Gentoo and OpenSUSE also have GTK 4 packages.
2023-06-27 14:32:53 +02:00
Package information for Arch, Debian/Ubuntu and Fedora is described by [Installing GTK from packages ](https://www.gtk.org/docs/installations/linux#installing-gtk-from-packages ).
2022-12-21 14:31:33 +01:00
The following table shows the distributions which support GTK 4.
2022-04-27 04:00:24 +02:00
2022-12-21 14:31:33 +01:00
|Distribution| version | GTK 4 | GNOME |
|:----------:|:-------------------------:|:-----:|:--------:|
| Fedora | 37 |4.8.2-2| GNOME 43 |
| Ubuntu | 22.10 | 4.8.1 |GNOME 43.0|
| Debian | bookworm(testing) | 4.8.2 | GNOME 43 |
| Arch | rolling release | 4.8.2 | GNOME 43 |
| Gentoo | rolling release | 4.8.2 | GNOME 43 |
| OpenSUSE |Tumbleweed(rolling release)| 4.8.2 | GNOME 43 |
2021-05-09 07:01:31 +02:00
2021-06-13 05:03:36 +02:00
## Installation from the source file
2021-04-26 04:44:35 +02:00
2022-12-21 14:31:33 +01:00
If you want to install a developing version of GTK 4, you need to build it from the source.
2023-01-19 06:24:22 +01:00
See [Compiling the GTK Libraries ](https://docs.gtk.org/gtk4/building.html ) section in the GTK 4 API reference.
2021-04-26 04:44:35 +02:00
2022-11-21 14:48:20 +01:00
Up: [README.md ](../README.md ), Prev: [Section 1 ](sec1.md ), Next: [Section 3 ](sec3.md )