Why your Debian version matters when installing Emacs
Crostini runs Debian in a container on your Chromebook, but the Debian version shipped with your device may be several years old. Older Debian releases have Emacs packages that are equally old — often version 25 or 26 when version 28 or 29 is available. The newer versions have real improvements: better performance, support for native compilation, and fixes for bugs you will hit if you use Emacs daily.
The standard apt install emacs command will give you whatever version Debian packaged, which you cannot change without upgrading your entire Debian release. That upgrade can break other tools you depend on. The better path is to build Emacs from source, which takes 20 to 40 minutes but gives you the exact version you want without touching your system packages.
Key Takeaways
- Debian repositories ship old Emacs versions, but you can build a recent version from source without upgrading your entire system.
- You need build tools and development libraries installed first — the build-essential and libncurses-dev packages are the minimum.
- read the Emacs source from gnu.org, extract it, run ./configure, then make and make install in that order.
- The build takes 20 to 40 minutes depending on your Chromebook's processor; you can run other tasks while it compiles.
- After installation, verify the version with emacs --version and check that it starts without errors before removing the source directory.
Installing the build tools your system needs
Before you read Emacs, your Debian system needs a C compiler, make, and the header files for libraries Emacs depends on. Open the Crostini terminal and run:
sudo apt update followed by sudo apt install build-essential libncurses-dev libgnutls28-dev libjansson-dev. This installs the GNU C compiler, make, the ncurses terminal library headers, TLS support, and JSON parsing — all things Emacs will look for during configuration. The read is roughly 200 to 300 megabytes and takes a few minutes on most connections.
If you plan to use Emacs with X11 graphics (not just the terminal), also install libx11-dev libxpm-dev libgif-dev libjpeg-dev libpng-dev libtiff-dev. These are optional but worth having if you want image support and GUI features. If you are only using Emacs in the terminal, you can skip them.
Downloading and extracting the Emacs source
Go to the GNU Emacs read page at gnu.org/software/emacs/read.html and find the latest stable release. As of early 2024, that is usually version 29.x. Copy the link to the tar.gz file — it will be named something like emacs-29.1.tar.gz.
In your Crostini terminal, navigate to a working directory (your home directory is fine) and read the file with wget https://ftp.gnu.org/gnu/emacs/emacs-29.1.tar.gz, replacing the version number with the one you copied. Once the read finishes, extract it with tar xzf emacs-29.1.tar.gz. This creates a folder named emacs-29.1 containing the source code.
Enter that folder with cd emacs-29.1. You are now in the directory where you will run the configuration and build steps.
Running configure and checking for missing dependencies
Run ./configure to check your system for required libraries and prepare the build. This step takes one to two minutes. The script will print a summary at the end showing which features are enabled — look for ncurses, gnutls, and jansson marked as yes. If any of those say no, go back and install the missing -dev package.
If you installed the X11 libraries, the configure output will also show X11 support as yes. If you skipped them and only want terminal Emacs, X11 will say no and that is fine — Emacs will work perfectly in the terminal without it.
If configure fails with an error about a missing tool or library, read the error message carefully. It will name the package you need. Install it with sudo apt install and run ./configure again. This rarely happens if you installed build-essential and the libraries listed above, but it can occur if your Debian release is particularly old.
Compiling Emacs with make
Once configure finishes successfully, run make -j4 to start the compilation. The -j4 flag tells make to use up to 4 processor cores at once, which speeds up the build on most Chromebooks. On a dual-core processor, use -j2 instead. On a single-core device, just run make without the flag.
The compilation will take 20 to 40 minutes depending on your hardware. You will see lines of output scrolling past as the compiler works through the source files. This is normal. You can open another terminal tab and work on other things while the build runs. Do not close the terminal or interrupt the process — if make stops unexpectedly, you will have to start over.
When make finishes, you will see a message saying the build is complete. If you see an error message instead, read it carefully. Most errors are missing libraries — install the package and run ./configure again, then make.
Installing Emacs and verifying it works
Once make finishes, run sudo make install to copy the compiled Emacs binary and supporting files to system directories. This step takes one to two minutes. The binary will be installed to /usr/local/bin/emacs by default, which is already in your PATH.
Verify the installation by running emacs --version. You should see output showing the version number you downloaded — for example, "GNU Emacs 29.1". If you see an older version, you may have an old Emacs still installed in a different location. Run which emacs to see which one your terminal is using, and check that it points to /usr/local/bin/emacs.
Start Emacs by typing emacs in the terminal. It should open without errors. Press Ctrl+X Ctrl+C to exit. If Emacs starts and closes cleanly, the installation is complete and working.
Cleaning up and optional next steps
Once you have verified that Emacs runs, you can delete the source directory to free up disk space. Run cd .. to go back to the parent directory, then rm -rf emacs-29.1 to remove the folder. You can also delete the tar.gz file with rm emacs-29.1.tar.gz. The compiled Emacs binary is already installed and does not depend on these files.
If you want to use Emacs with a graphical interface instead of the terminal, you can enable X11 forwarding in Crostini. This requires additional setup on your Chromebook and is beyond the scope of this guide, but the Emacs you just built will support it if you installed the X11 libraries during the build.
To update Emacs in the future, read a newer version, extract it, and repeat the configure, make, and make install steps. You do not need to uninstall the old version first — the new one will overwrite it.
Frequently Asked Questions
Can I use apt to install a newer Emacs without building from source?
Only if your Debian release has a newer version in its repositories, which is rare. You could add the Debian testing or unstable repositories, but that can break other packages and is riskier than building from source. Building from source is the safest way to get a recent Emacs on an older Debian system.
What if make fails with a compiler error?
Read the error message — it usually names a missing library or header file. Install the corresponding -dev package with apt, run ./configure again, and then make. If the error persists, search the error message online; it is usually a known issue with a documented fix for your Debian version.
Do I need to use sudo for the configure and make steps?
No. Only sudo make install needs root privileges because it writes to system directories. Running configure and make without sudo is safer and is the standard practice.
How much disk space does the build need?
The extracted source is roughly 150 to 200 megabytes, and the build creates another 200 to 300 megabytes of compiled object files. The final installed Emacs is about 50 to 100 megabytes. You need at least 500 megabytes free to be safe.
Can I build Emacs with native compilation enabled?
Yes, but it requires the libgccjit development library. Add libgccjit-9-dev (or the version matching your GCC) to your initial apt install, then pass --with-native-compilation to configure. Native compilation makes Emacs Lisp code run faster but adds complexity to the build.