Emacs, the powerful and extensible text editor beloved by developers, writers, and researchers, has been around for decades—and it’s still evolving. However, if you’re running an older Debian-based Linux environment, particularly in Crostini (Google’s container-based Linux support for ChromeOS), getting your hands on the latest version of Emacs can be tricky. The default package repositories often contain outdated versions, and official backports might not be available or up to date. Luckily, with a little effort, you can build and run the latest version of Emacs on your Crostini container. Read on to learn how!
TL;DR
If you’re using Crostini on a Chromebook and want the latest Emacs, the default Debian repositories won’t cut it—they usually lag behind by a few versions. The easiest way to get the latest release is to compile Emacs from source. This article walks you through installing the dependencies, downloading the source, and building Emacs yourself in Debian running within Crostini. It’s easier than it sounds—and worth the few steps it takes!
Why You Might Want the Latest Emacs
With each new release of Emacs, users gain access to improved performance, bug fixes, new packages, and better usability in areas like built-in LSP (Language Server Protocol), visuals, and even native JSON support. If you’re stuck with Emacs 26 or earlier on your Chromebook, you’re missing out on faster loading times, visual tweaks, and new programming features brought in Emacs 28, 29, and beyond.
Crostini typically installs Debian 10 (Buster) or Debian 11 (Bullseye), depending on your device and updates—but these versions do not include the newest Emacs builds in their package repositories. That’s why building from source becomes your best bet.
Things You’ll Need
- A Chromebook with Linux (Crostini) enabled
- Some disk space (around 1GB recommended for build files)
- Terminal access in your Linux container
- A little patience—it may take 10 to 20 minutes to build
Step 1: Update Your Linux Container
Before you do anything else, make sure your environment is up to date. Open your Terminal and type:
sudo apt update
sudo apt upgrade
This ensures all package info is current and prevents unwanted errors later on during dependencies installation.
Step 2: Install Dependencies
Building Emacs from source needs quite a few system packages. You’ll need compilers, development libraries, and build tools. Run the following command:
sudo apt install build-essential checkinstall \
libgtk-3-dev libgnutls28-dev libjpeg-dev \
libtiff5-dev libgif-dev libncurses-dev \
libxpm-dev libxaw7-dev texinfo libgccjit-10-dev \
git libjansson-dev libharfbuzz-dev libtree-sitter-dev
Note that Debian 11 and up usually include libgccjit-10-dev, which you’ll want if you’re considering native-comp builds (optional). If you’re on Debian 10, you may need to compile libgccjit separately—which is beyond this article’s scope.
Step 3: Download the Emacs Source Code
Grab the latest stable source code from the official GNU Emacs Git repository. Clone it using Git (this will give you access to all versions, not just the latest):
git clone https://git.savannah.gnu.org/git/emacs.git
cd emacs
git checkout emacs-29
Tip: Use git tag to see available versions if you’re interested in a different release.
Step 4: Configure the Build
Before compiling, you can customize features and add optional modules. The most basic configuration goes like this:
./autogen.sh
./configure --with-modules --with-x-toolkit=gtk3
If you want the native compilation feature (great performance boost for larger configurations like Doom Emacs or Spacemacs), add:
./configure --with-native-compilation --with-modules --with-x-toolkit=gtk3
Keep in mind this will significantly increase compile time and requires libgccjit, which, again, may not be available out-of-the-box on older Debian.
Step 5: Compile and Install
With everything configured, start building Emacs:
make -j$(nproc)
This command makes use of all available CPU threads to speed up the process. Once it’s done—usually within 10–20 minutes—you can install Emacs:
sudo make install
By default, Emacs will install in /usr/local/bin/emacs. You can verify installation with:
emacs --version
Step 6: Set Up Desktop Launch Icon (Optional)
If you’d like to launch Emacs from your ChromeOS app drawer instead of just the terminal, you can create a simple .desktop file in ~/.local/share/applications:
mkdir -p ~/.local/share/applications
nano ~/.local/share/applications/emacs.desktop
Paste the following:
[Desktop Entry]
Version=1.0
Name=Emacs
Exec=/usr/local/bin/emacs
Icon=emacs
Type=Application
Categories=Development;TextEditor;
Then save and exit with Ctrl+O, Enter, and Ctrl+X. It may take a few seconds, but Emacs should now appear in your graphical launcher.
Keeping Emacs Up to Date
The beauty of compiling from source is that it’s easy to pull updates. Every few weeks, you can run:
cd ~/emacs
git pull
make -j$(nproc)
sudo make install
This keeps you current without depending on Debian packages or waiting for releases.
Image not found in postmeta
Bonus: Troubleshooting Tips
- “libgccjit not found”? Try building without native compilation using
--without-native-compilation. - Fonts look pixelated? Install
fonts-dejavuor other font packages for smoother rendering. - X11 errors? Make sure your Crostini container has X11 backend working and you’re running inside a graphical shell like
xfceor forwarding X apps to the container.
Emacs in Crostini: Final Thoughts
Even on a relatively constrained platform like Crostini, you can unlock the full power of modern Emacs with a few terminal commands and a short wait for compilation. By choosing to build from source, you not only get the very latest features and the option to enable high-performance modes like native compilation—you also gain better control of your development environment on ChromeOS.
If you’re a daily Emacs user or just curious about how powerful it can be, going beyond the repo version is absolutely worth the journey. Enjoy rapid startup times, better GUI integration, and access to the newest packages and features right from your Chromebook.
Welcome to the cutting edge—right from your Crostini terminal!