How to Install Emacs 27.1 via PPA in Ubuntu 20.04, 18.04, 16.04

Last updated: April 24, 2024

For those prefer Deb package to the containerized Snap or Flatpak package, Emacs text editor 27.1 now is available to install via an Ubuntu PPA for all the current releases.

GNU Emacs 27.1 was released more than 1 month ago. Thanks to Kevin Kelley, you can now install it in Ubuntu via this PPA repository.

The PPA package features:

  • native support for JSON
  • support for ACLs
  • support for libgmp
  • support for enhanced text rendering through Cairo and HarfBuzz
  • remove ImageMagick support
  • remove xwidgets support for Ubuntu 16.04.

1. Open terminal either from system application launcher or by pressing Ctrl+Alt+T on keyboard. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:kelleyk/emacs

Type user password (no asterisk feedback) if it asks and hit Enter to continue.

2. Then refresh system package cache and install the editor via 2 commands:

sudo apt update

sudo apt install emacs27

If you want, you can install the text-only user interface via sudo apt install emacs27-nox.

The PPA also contains emacs26 and emacs25 packages for choices.

(Optional) To uninstall the PPA, either go to ‘Software & Updater -> Other Software’, or run command:

sudo add-apt-repository --remove ppa:kelleyk/emacs

And remove the Emacs text editor if you want by running command:

sudo apt remove --autoremove emacs27

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

8 responses to How to Install Emacs 27.1 via PPA in Ubuntu 20.04, 18.04, 16.04

  1. Already had emacs 26.3 installed, tried to install 27.1 but it clashed with previous version:

    sudo apt install emacs27
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following additional packages will be installed:
    emacs27-common
    The following NEW packages will be installed:
    emacs27 emacs27-common
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 21,9 MB of archives.
    After this operation, 95,8 MB of additional disk space will be used.
    Do you want to continue? [Y/n]
    Get:1 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal/main amd64 emacs27-common all 27.1~1.git86d8d76aa3-kk2+20.04 [18,2 MB]
    Get:2 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal/main amd64 emacs27 amd64 27.1~1.git86d8d76aa3-kk2+20.04 [3651 kB]
    Fetched 21,9 MB in 30s (725 kB/s)
    Selecting previously unselected package emacs27-common.
    (Reading database … 227516 files and directories currently installed.)
    Preparing to unpack …/emacs27-common_27.1~1.git86d8d76aa3-kk2+20.04_all.deb …
    Unpacking emacs27-common (27.1~1.git86d8d76aa3-kk2+20.04) …
    dpkg: error processing archive /var/cache/apt/archives/emacs27-common_27.1~1.git86d8d76aa3-kk
    2+20.04_all.deb (–unpack):
    trying to overwrite ‘/usr/include/emacs-module.h’, which is also in package emacs-common 1:2
    6.3+1-1ubuntu2
    dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
    Selecting previously unselected package emacs27.
    Preparing to unpack …/emacs27_27.1~1.git86d8d76aa3-kk2+20.04_amd64.deb …
    Unpacking emacs27 (27.1~1.git86d8d76aa3-kk2+20.04) …
    Errors were encountered while processing:
    /var/cache/apt/archives/emacs27-common_27.1~1.git86d8d76aa3-kk2+20.04_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    • Try removing Emacs 26.3 first via command:

      sudo apt remove --autoremove emacs-common

      • Thanks for suggestion,
        sudo apt remove emacs
        didn’t do the job, neither did
        apt –fix-broken install
        finally managed to have successful install of emacs27 w/o snap.

  2. Installation fails on Ubuntu 20.04 Focal, could find a way to submit bug report for this package.

    Linux 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  3. I struggled to install it here and it’s because you need to fully remove emacs 26 first. The comment Ji posted above was part of it for me. I had to remove the whole program, along with my failed install, before it was successful. Running something like the below command got me there. I don’t know anything so I recommend backing up your config before doing this

    sudo apt remove –autoremove emacs emacs27 emacs-common

  4. I kept getting unmet dependency errors.

    I had to remove a lot of extra packages for this to work.

    sudo apt remove emacs26-common emacs26 emacs-common emacs apel flim w3m-el emacs-el emacs-bin-common

    After that, I could finally do sudo apt install emacs27 and it worked.

    It also had to re-download all of my packages on the first run, so the first run was especially slow.

    But now, everything’s fine.

    • Thank you!

      However, if you get `emacs-gtk : Dependency: emacs-bin-common (= 1:26.3+1-1ubuntu2) but it’s not trying to install`, you may need to run `sudo dpkg –remove –force-remove-reinstreq emacs27` seems to need to be executed.

  5. Greatly appreciate this blog post as I was able to install emacs27-nox on the Windows 10 Ubuntu 20.04 LTS application.