Building from Source
Most MATE packages must be installed, not just compiled. The installation step copies desktop files, GSettings schemas, icons, and shared libraries to the locations the rest of the system expects to find them.
/usr overwrites your distribution’s packaged version of that component. Always work inside a virtual machine so your main system stays intact.Clone the repository
All MATE repositories are hosted under github.com/mate-desktop. Clone the one you want to work on:
git clone https://github.com/mate-desktop/<package-name>
cd <package-name>
git submodule update --init --recursiveThe submodule step is only needed for packages that have them (most do not).
Install build dependencies
The easiest way to get all required headers and libraries is to ask the package manager for the build-dependencies of the already-packaged version:
First make sure source repositories are enabled — apt build-dep reads from them:
sudo apt-get build-dep <package-name>If the package is not in your repositories, install the dependencies manually by looking at the configure.ac or meson.build file for PKG_CHECK_MODULES calls.
Build systems
Most MATE packages support both Autotools (autogen.sh + make) and Meson (meson + ninja). Both are fine. Meson is faster for incremental builds.
Autotools
./autogen.sh --prefix=/usr
make -j$(nproc)--prefix=/usr is important — without it, files land in /usr/local and many components will not find each other at runtime (D-Bus services, GSettings schemas, icon themes).
-j$(nproc) compiles on all available CPU cores.
To see every available configure option:
./autogen.sh --helpCommon flags:
| Flag | Effect |
|---|---|
--enable-debug | Enable extra runtime checks (if supported) |
--disable-silent-rules | Show the full compiler command for each file |
--with-gtk=3.0 | Select GTK version (where configurable) |
Meson
meson setup build --prefix=/usr
ninja -C build -j$(nproc)To see all build options:
meson configure buildChange an option after the initial setup:
meson configure build -Doption=value
ninja -C buildInstall
Autotools
sudo make installMeson
sudo ninja -C build installVerify the installation
Check that the new binary is picked up:
which <binary-name>
<binary-name> --versionFor GSettings schemas to take effect immediately without logging out:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/Rebuild after changes
Only the files that changed are recompiled. After editing source files:
Autotools
make -j$(nproc)
sudo make installMeson
ninja -C build -j$(nproc)
sudo ninja -C build installFor some components you can run the binary directly from the build tree without installing — useful for quick tests. Whether this works depends on the component: standalone applications often work, while panel applets and background daemons generally require installation.
Debug builds
To produce debug symbols and disable optimisation (required before using GDB or Valgrind — see Debugging):
Autotools
./autogen.sh --prefix=/usr CFLAGS="-g -O0"Meson
meson setup build --prefix=/usr --buildtype=debugUninstall
Autotools
sudo make uninstallMeson
Meson does not have a built-in uninstall target, but it records every installed file:
sudo ninja -C build uninstallCommon errors
configure: error: Package requirements ... were not met
A required library or its development headers are missing. The error message names the pkg-config package. Install the corresponding -dev / -devel package.
GLib-GIO-ERROR: No GSettings schemas are installed
The schemas were not compiled after installation. Run:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/error while loading shared libraries
A newly installed library is not visible to the dynamic linker. Run:
sudo ldconfigIcons or theme not updating Regenerate the icon cache for the affected theme:
sudo gtk-update-icon-cache /usr/share/icons/<theme-name>/