July 25, 2025 · (updated August 9, 2025) · 4 min · 722 words · Kristian Alexander P
Figure 1: Emacs WSL
For some reason, I needed to work on Windows, and considering my shift is a 12 hours work, I needed something to tinker when I get some quiet time. I just realised it’s been years since I’ve use Windows for something other than web browsing.
So this post is an experience on installing Emacs on Debian.
You should follow the official documentation on how to install WSL, so I won’t be writing about it here.
As for the reasoning for choosing Debian? Because it’s not Ubuntu, nothing against it, I just wan’t a simpler distro, and I use archlinux, this is WSL, it’s doesn’t make any sense trying to have archlinux inside it.
Out of the box, the sources list doesn’t have any of the deb-src and non-free-firmware stuffs.
1
2
3
4
5
6
7
8
9
10
deb http://deb.debian.org/debian bookworm main non-free-firmwaredeb-src https://deb.debian.org/debian bookworm main non-free-firmwaredeb http://deb.debian.org/debian bookworm-updates main non-free-firmwaredeb-src https://security.debian.org/debian-security bookworm-security main non-free-firmwaredeb http://security.debian.org/debian-security bookworm-security main non-free-firmwaredeb-src https://deb.debian.org/debian bookworm-updates main non-free-firmwaredeb http://ftp.debian.org/debian bookworm-backports main non-free-firmware
mkdir -pv sources
cd ~/source/
git clone https://github.com/tree-sitter/tree-sitter.git
cd tree-sitter
make
sudo make install
or you could also use apt to install it. This is not a hard dependency, so it can be skipped if not used.
As for the Emacs source, I use the tarball, their git repo is just too large. If you want to use their git repo I recommend using the –depth=1 option.
1
2
3
4
cd ~/sources
wget https://ftp.gnu.org/gnu/emacs/emacs-29.4.tar.xz
tar xf emacs-29.4.tar.xz
cd emacs-29.4
So this is my configure options:
1
2
3
./configure --with-native-compilation --with-pgtk --with-tree-sitter --with-modules --with-threads --with-mailutils --with-imagemagick --with-json
make
sudo make install
I suppose you can use other flags, but for now this is more than enough for me.
This will install Emacs using the default prefix (/usr/local), meaning the binary will be placed at /usr/local/bin/. Debian already include them to the shell path.
This font collection is not on Debian repository. I just pick some script I got from github, and modified it to store the fonts to ~/.local/share/fonts.
fons_list=("Agave""AnonymousPro""Arimo""AurulentSansMono""BigBlueTerminal""BitstreamVeraSansMono""CascadiaCode""CodeNewRoman""ComicShannsMono""Cousine""DaddyTimeMono""DejaVuSansMono""FantasqueSansMono""FiraCode""FiraMono""Gohu""Go-Mono""Hack""Hasklig""HeavyData""Hermit""iA-Writer""IBMPlexMono""InconsolataGo""InconsolataLGC""Inconsolata""IosevkaTerm""Iosevka""JetBrainsMono""Lekton""LiberationMono""Lilex""Meslo""Monofur""Monoid""Mononoki""MPlus""NerdFontsSymbolsOnly""Noto""OpenDyslexic""Overpass""ProFont""ProggyClean""RobotoMono""ShareTechMono""SourceCodePro""SpaceMono""Terminus""Tinos""UbuntuMono""Ubuntu""VictorMono")for font_name in "${fons_list[@]}";doif[ -n "$font_name"];thenecho"Starting download $font_name nerd font"if["$(command -v curl)"];thenecho"https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font_name.zip" curl -OL "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font_name.zip"echo"creating fonts folder: ${HOME}/.local/share/fonts" mkdir -p "$HOME/.local/share/fonts"echo"unzip the $font_name.zip" unzip "$font_name.zip" -d "$HOME/.local/share/fonts/$font_name/" fc-cache -fv
echo"$font_name done!"elif["$(command -v wget)"];thenecho"https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font_name.zip" wget "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$font_name.zip"echo"creating fonts folder: ${HOME}/.local/share/fonts" mkdir -p "$HOME/.local/share/fonts"echo"unzip the $font_name.zip" unzip "$font_name.zip" -d "$HOME/.local/share/fonts/$font_name/" fc-cache -fv
echo"done!"elseecho"We cannot find the curl and wget command. First, install the curl and wget command, one of them."breakfifidone
Please beware this will download automatically all the font in the font_list. And you don’t have to download them all, see all the available fonts at https://www.nerdfonts.com/font-downloads.