To have the latest emacs, on ubuntu 22.04 I activated the ppa https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa and installed emacs-snapshot from there. When starting it I get the warning:

You are trying to run Emacs configured with the "pure-GTK" interface under the X Window System. That configuration is unsupported and will lead to sporadic crashes during transfer of large selection data. It will also lead to various problems with keyboard input.

This happens when I log in with either xfce or Ubuntu(standard) on the login screen. My screen manager is lightdm, if that has any relevance here.

Obviously I should not be using this version of emacs or start it with some different environment or command line argument. Is there any way to start it correctly? Is there a more suitable ppa to get a rather new version of emacs?

3 Answers 3


Another PPA for Emacs is the one from kelleyk. As of this writing, the latest version it has is 28.1, and it's not built with pgtk so Xorg users won't get that warning.

If you're going to try this one, completely uninstall the emacs from the first PPA before installing this one. You may also need to remove the first PPA too, but I'm not sure. Also, if you want native compilation enabled, you have to explicitly install emacs28-nativecomp.


This means that it was compiled with pure-GTK (Wayland). You are seeing this warning as you are using X instead. I am not aware of another ppa, but there probably is one.

You could use the 'latest/edge' version of the snap instead:

sudo snap install emacs --edge --classic

Or even better imo just compile it yourself which is actually very easy and quite fast:

# Install dependencies for Ubuntu 22.04
# In older releases of Ubuntu some dependencies have other names or are not 
# available. If you have Ubuntu 21.04 or an older release make sure to install 
# tree-sitter from source to get native tree-sitter support.
# Got the dependencies from the snap and from 'apt-cache depends emacs-gtk'.

sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \
    gcc-10 libacl1-dev libasound2-dev libdbus-1-dev libgccjit-10-dev \
    libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev \
    libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev \
    liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev \
    libsystemd-dev libtiff-dev libxi-dev libxml2-dev libxpm-dev libxt-dev \
    procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base \
    libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 \
    libatspi2.0-0 libbrotli1 libc6 libc6-dev libcairo-gobject2 libcairo2 \
    libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libdatrie1 \
    libdb5.3 libdrm2 libegl1 libepoxy0 libflac8 libfontconfig1 libfreetype6 \
    libgbm1 libgccjit0 libgcc-s1 libgdk-pixbuf2.0-0 libgif7 libgl1 \
    libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \
    libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 \
    libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 \
    libicu70 libisl23 libjansson4 libjbig0 libjpeg-turbo8 liblcms2-2 \
    liblockfile1 libltdl7 libm17n-0 libmpc3 libmpfr6 libnotify4 libnss-mdns \
    libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf1 \
    libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 \
    libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 \
    libsndfile1 libsoup2.4-1 libssl3 libstdc++6 libtdb1 libthai0 libtiff5 \
    libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \
    libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp7 \
    libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 \
    libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 \
    libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 \
    libxrandr2 libxrender1 libxslt1.1 libyajl2 libwebp-dev libtree-sitter0 \
    libtree-sitter-dev emacs-bin-common emacs-common libcairo2-dev \
    libdbus-1-3 libfontconfig1-dev libfreetype6-dev libglib2.0-0 libgmp10 \
    libgnutls30 libgpm2 libharfbuzz0b libjpeg8-dev libtinfo-dev \
    build-essential libxfixes-dev libxrender-dev libsqlite3-dev libc6 \
    libc6-dev libenchant-2-dev
# Clone Emacs master
cd ~
git clone --depth 1 git://git.sv.gnu.org/emacs.git

# Install it

export CC="gcc-10" CXX="gcc-10"
# Turns native compilation on. Remove if you don't want this.
./configure --with-json --with-native-compilation
make -j $(nproc)
sudo make install
  • 1
    To speed up compilation, I'd say make -j $(nproc) to take advantage of all the available cores on your system.
    – g-gundam
    Dec 22, 2022 at 8:57
  • 1
    @g-gundam Thanks for the input, edited the code accordingly. And will use this myself next time :-)
    – Hubisan
    Dec 22, 2022 at 9:11

Currently, there are three ppa's:

  • Kevin Kelley: unofficial builds from series 25.x to 28.x. Currently outdated with last published version stalled at 28.1. Although it has been a "default" ppa for Emacs users on Ubuntu during many years, I do no longer recommend it.
  • Panda Jim: unofficial builds of series 29.x. I recommend this ppa for and up-to-date stable release.
  • "Ubuntu Emacs Lisp" team: The Official ;-) Ubuntu Emacs Daily Snapshot PPA. I am currently using this one and, since I am experiencing problems with later snapshots, I have on hold the 2023.11.31 daily snapshot of version 30.5.

From release 22.04 onward, Ubuntu ships with Gnome on Wayland. For compatibility with the "pure-GTK interface", you need to enter a Wayland session. From the default greeter, gdm3, upon selecting the user, click on the option cog to select "Ubuntu on Wayland" or "GNOME Classic on Wayland".

This is similar if you use the LightDM greeter. However, Xfce has not yet been fully ported to Wayland so you must use compatible builds or build it yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.