How to Install GNU Emacs on Ubuntu 22.04

Introduction

Before we begin talking about how to install GNU Emacs on Ubuntu 22.04, let's briefly understand – What is GNU Emacs?

GNU Emacs is a powerful and versatile text editor that provides a wide range of features for writing and editing text. Developed by Richard Stallman and the GNU Project, it is free and open-source, allowing users to customize and extend its functionality to suit their needs.

With its flexible interface, extensive collection of built-in commands, and support for various programming languages, GNU Emacs has become a popular choice among programmers and writers who seek a highly customizable and efficient editing tool.

In this tutorial, you will install GNU Emacs on Ubuntu 22.04. We will also address a few FAQs on how to install GNU Emacs on Ubuntu 22.04.

Advantages of GNU Emacs

  1. Versatility: GNU Emacs can handle a vast range of tasks, from text editing to code development, making it a versatile tool for programmers and writers.
  2. Customizability: With extensive customization options, users can tailor GNU Emacs to their preferences, optimizing their editing experience.
  3. Productivity Features: GNU Emacs offers advanced features like syntax highlighting, auto-completion, and powerful search capabilities, enhancing productivity and efficiency.
  4. Extensibility: Users can extend Emacs with a vast library of add-ons, further enhancing its functionality for specific needs.
  5. Cross-Platform Compatibility: GNU Emacs runs on various operating systems, ensuring users can access their preferred text editor regardless of their platform.

Steps to install Emacs text editor on Ubuntu 22.04 LTS Linux

Method 1: Using the APT package manager:

1. Run system update

To obtain the most recent version of the packages already installed on your system and to clear the repository cache, use the system update command.

sudo apt update

2. Install Emacs on Ubuntu 22.04

To download the Emacs packages, we don't need to manually add any repositories to our Ubuntu system. It is already included in this Linux system's stable base repository. Therefore, run:

sudo apt install emacs

Method 2:  using SNAP:

3. Use Snap to install Emacs

We already have SNAP installed on Ubuntu 22.04 LTS. Thus, we can utilize it to obtain the packages instantaneously and install this text editor on our system.

sudo snap install emacs --classic

Method 3: Use GUI Ubuntu software:

4. Emacs GUI or Terminal from Ubuntu Software

On Ubuntu 22.04, select the Ubuntu software icon located in the Dock. Next, look for "emacs" by clicking on the Search icon located in the upper left corner. Install the GUI or Terminal based on your preference from the results.

5. Start

On the Command terminal, the text editor can be used both with and without a graphical user interface. Navigate to All Applications, search for Emacs, and click its icon to launch it.

As an alternative, you can launch this text editor in the Terminal by typing the command shown below.

emacs      # Start with GUI
emacs -nw  # Start in Terminal, --no-window-system

The only language used to configure Emac is elisp; ready-made extensions can be installed using internal package management. Additionally, you have the option to store your configuration in the ~ /.emacs.d or ~ /.emacs file.

6. How to update Emacs

To keep your Emacs application up to date, use the appropriate method:

For APT Users:

sudo apt update & sudo apt upgrade

For Snap:

sudo snap refresh emacs

For GUI:

Launch the Ubuntu software, search for Emas, select it from the list of results, and then click the Update button (which will only appear if the program has any updates available).

7. Uninstall or Remove Emacs from Ubuntu 22.04

We've demonstrated several ways to install Emacs here; therefore, use the instructions provided to uninstall it as well, depending on which method you used.

For the APT method:

sudo apt autoremove --purge emacs

For Snap Method:

The following command can be used to remove Emacs by those who installed it using SNAP:

sudo snap remove emacs

For GUI:

Once more, launch the Ubuntu software and look for Emacs. Click on the Bin icon after opening the app and seeing its icon appear.

FAQs to install GNU Emacs on Ubuntu 22.04

Can I install GNU Emacs from the Ubuntu Software Center? 

Yes, you can install GNU Emacs from the Ubuntu Software Center. Open the Software Center, search for "GNU Emacs," and click on the "Install" button to initiate the installation process.

Is there a specific version of GNU Emacs available for Ubuntu 22.04? 

Ubuntu 22.04 provides the latest stable version of GNU Emacs available in its software repositories. You will get the most recent and supported version through the standard installation process.

Can I customize the look and feel of GNU Emacs on Ubuntu? 

Yes, GNU Emacs allows extensive customization. You can modify the appearance, themes, fonts, and more by modifying the Emacs configuration file called ".emacs" or using the built-in customization options.

Can I use GNU Emacs as my default text editor in Ubuntu 22.04? 

Yes, you can set GNU Emacs as the default text editor in Ubuntu 22.04 by going to System Settings > Details > Default Applications and selecting GNU Emacs as the default in the Text Editor section.

How can I update GNU Emacs to the latest version on Ubuntu 22.04? 

By periodically running "sudo apt-get update" followed by "sudo apt-get upgrade", you can update all installed packages on Ubuntu, including GNU Emacs, to the latest available versions.

Is it possible to install additional packages and extensions in GNU Emacs? 

Yes, you can install additional packages and extensions in GNU Emacs. Use the built-in package manager called "package.el" or explore the extensive Emacs package ecosystem available online.

Can I use GNU Emacs on other platforms besides Ubuntu 22.04? 

Yes, GNU Emacs is cross-platform and can be installed and used on various operating systems such as Windows, macOS, and Linux distributions beyond Ubuntu 22.04.

Conclusion

We hope this tutorial helped you understand how to install GNU Emacs on Ubuntu 22.04.

If you have any queries, please leave a comment below, and we’ll be happy to respond to them for sure.