Install Emacs stable release on Chrome OS
2020-01-11What I want is to install the stable version of Emacs on my Chromebook. After all, my Chromebook is on stable channel. The most recent stable version of Emacs is 26.3 now, the most recent version of Chrome OS is 79 now, and the most recent Debian version on Chrome OS 79's Linux enviroment is Strech now.
Install Emacs stable release on a rolling release Linux like Arch linux is a piece of cake, because you are always up to update.
Install Emacs stable on Debian/Ubuntu unstable is also easy, there are prebuild 26.3 version you can install directliy.
However, As of Chrome OS 79, the Crostini Linux enviroment is still at stretch -- the oldstable release, the newest package we can get is emacs25. Install Emacs stable on Chrome OS require extra works.
Why I can't get ease with emacs25 on Debian Stretch is that When I install evil-mode via MELPA, I get some error saying undo-tree can not be installed. It seems like it is related to some BUG in Emacs 25, but has been fixed in Emacs 26 which is the stable version now. So Emacs 26 is what I needed.
The first thing I tried is install Emacs 26.3 via flatpak, although I can get emcas26 up and runinng, I can't do any useful thing with it, the m-x term is a shell inside flatpak container, which is not I want. I think install Emcas in container is the wrong way. So what I have to do is to install it as a normal application.
I spend some time searching for prebuilt Emacs stable (26.3) packages for Debian stretch (oldstable) on EmacsWiki and Debian sites without lucky, so that means I have to build my Emacs 26.3 myself. There are 3 ways to do this, orderd by recommendations priority.
-
use Debian backport method if the version of software required is in newer version of Debian Debian Wiki says this way won't mess up with your package system.
-
use Ubuntu PPA port to Debian method if the version of required is in Ubuntu PPA
-
build directly from sources
Because Emacs version 26.3, which is what I needed, is on Debian unstable (sid), so I decided to go with the first method, following the Simple Backport Creation Guide. After some tweak, I built and installed it with success.
The Debian Simple Backport Guid should be followed exactly, but in case I will needed to do this again, there some gotcha to be remembered.
-
The
rmadisoncommand is frompackaging-dev, you can use it to check which version is available in Debian archive. -
Before started, uninstall all packages whose name begin with
emacsandemacsenwithapt purge, if you installed old version of Emacs before. -
In order to download Emacs source form
sid, you need to add these lines to yoursource.listdeb http://deb.debian.org/debian sid main non-free deb-src http://deb.debian.org/debian sid main non-free
Only add the second line will not will. Then do
apt updateAnd then download source with
apt source -t sid emacsAfter that and before building, delete these lines form your
source.listand doapt updateagain. This is important, or else you will build your emacs on wrong debian version. Remember we want to build Emacs on Strech. -
fakeroot debian/rules binaryrequire a lot time, it can be safely skipped. -
In my enviroment, I need
emacsen-commonto sucessful installemacs, and also needemacs-common-non-dfsgfor Emacs Info document, which is fromnon-freechannel. -
To install a deb file under current path, you need to prefix it with
./ -
I need to specify all deb files in order to successful install, which is
apt install ./emacs_*_*.deb ./emacs-common_*_*.deb \
./emacs-bin-common_*_*.deb ./emacs-gtk_*_*.deb
-
Backup these deb files to some place, you can reinstall them someday without rebuild
-
In order to make text bigger, add
sommeiler -X --dpi=175to/usr/share/application/emacs.desktop'sExesection. -
In order to see all fonts in Emacs Hello file with
C-h h, I need to install these fontsapt install -t stretch-backport fonts-noto fonts-noto-cjkNote: strech-backport channel's fonts is newer than strech channel's.
After all these steps, I can happily play with emacs stable release on my Chromebook now :-)