hubisan / emacs-wsl

Install and run Emacs with the Windows Subsystem for Linux (WSL 2) in Windows 10 or 11.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alternative Ubuntu versions and other ways to install Emacs

dalanicolai opened this issue · comments

Thanks for this great guide.

I tried, with succes, a little variant to yours to get a newer version of Emacs (it only gives me version 27.1 but that is already sufficient for me). Just sharing the info here for anybody interested.

To get there I just used an Ubuntu upgrade (to 21.04) and then installed Emacs in the usual (apt) way.

For that we can just install the Ubuntu version (instead of Ubuntu 20.04) from the Microsoft store. Then follow this very brief guide to upgrade to Ubuntu 21.04 (it says 20.10 because the guide is a little older). THE GUIDE DOES NOT MENTION that snapd should be removed first, otherwise the upgrade will fail because it can not check snap package versions.

Then finally, change the two Ubuntu-20.04 in wsl-2_4-emacs.ps1 to simply Ubuntu.

The rest will work like explained in this emacs-wsl guide.

Another "advantage" of this approach is that you can keep upgrading Ubuntu when a new version is released. I think with the Ubuntu-20-04 app you must reinstall everything when a new LTS is released (not sure though)

Thanks for your input. To summarize, this and also an input from another issue:

Ubuntu Versions

  • This guide is using the Ubuntu 20.04 from the Microsoft store. This means it will not be updated to the next LTS release. This also means that if a new Ubuntu LTS is released, you will have to install it and start from scratch.
  • You can use the Ubuntu one (without a version). As far as I know, it will be upgraded to the next LTS release automatically.
  • If you want to use a non-LTS release, you can follow the short guide mentioned above in this issue.

If using another version, make sure to remove or change the hard-coded versions in the scripts.

Should probably remove the hard-coded version of Ubuntu in the scripts. Will have a look at it when the next LTS is released ;-)

Ways to install Emacs

  1. Install the latest version from source as described in this guide.
  2. Use the personal package archive ppa:kelleyk/emacs (installs 27.1 instead of 27.2 last time I checked):
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt install emacs27
  1. With Ubuntu 21.04 (see above) one can install Emacs 27.1 by running sudo apt install emacs.

I prefer to just install it from source as it is straight-forward and doesn't take long.