[4 Methods] How to Install Emacs in Linux?

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Emacs is a highly configurable free text editor (also referred to as a family of text editors) that comes with rich editing features. It stands for “Editor Macros” which provides a wide array of features for text editing, code development (as IDE), and productivity tasks. The foremost step to start working with Emacs is to have a graceful installation of the text editor in the system. Therefore, this article discusses several effective methods of how to install Emacs in Linux (specifically in Ubuntu/Debian-based distributions).

Method-1: Install Emacs Using “apt” Package Manager

Installing the Emacs text editor using a distribution’s package manager demands using several easy commands in the terminal. For instance, apt or apt-get is used in Debian-based distributions and Yum or DNF for Redhat-based distributions. This section shows how to install the Emacs editor in Ubuntu using the apt package manager.

So, Here’s a step-by-step guide to installing Emacs in Ubuntu using the command line:

  1. Run the following command first to update the system repository list:
    sudo apt update

    sudo apt update before emacs installation

  2. Now, run the command mentioned below to install the Emacs text editor:
    sudo apt install emacs

    apt installing emacs

    Note: You can also use the command sudo apt install emacs -y for installation. This directly completes installation without prompting for pressing “y” later.
  3. Finally, to verify the installation, use the following command:
    emacs --version

    emacs installation verificationThe image states that the Emacs text editor version 27.1 is installed successfully.

Note: Additionally, in Redhat-based distributions, execute this command to install Emacs: yum install emacs. Anyway, remember to suit your installation according to your system’s distribution.

Method-2: Using “snap” Command

The snap command is another useful tool for installing the Emacs text editor, available from the Snap Store. To install the Emacs text editor using “snap”, open the terminal and run the following command:

sudo snap install emacs --classic

emacs installation using snapSnap successfully installs the Emacs text Editor in Ubuntu.

Method-3: Using PPA Repository

The PPA (Personal Package Archive) is the subset of apt repositories particularly available in Ubuntu/Debian-based distributions. It provides the users with software with the latest version updates (not always found in the official ones). One good advantage to installing Emacs with ppa is it gives access to the latest released version of the software.

Here’s a step-by-step guide on how to install Emacs in Ubuntu using the ppa repository:

  1. The first step is to add the Emacs ppa repository. To add the ppa repository, run the following command:
    sudo add-apt-repository ppa:kelleyk/emacs

    adding ppa repository

  2. After updating the system repository list using sudo apt update, execute the command below to install the latest version:
    sudo apt install emacs
  3. Finally, run the emacs --version command to verify the installation of the latest version:
    verify emacs installation with ppaThe Emacs with the latest release (version 29.3) has been installed using ppa.

Method-4: Using the Graphical User Interface (GUI)

The Graphical User Interface (GUI) provides users with a visual interface for installing the Emacs text editor. It is the most beginner-friendly method that requires no use of commands or the terminal. Follow the guide below to install Emacs in Ubuntu using GUI:

  1. First, go to the application menu and Access Ubuntu Software:going to ubuntu software
  2. Then search for Emacs and select.finding emacs in ubuntu software
  3. Now, click theInstall  button for Emacs (GUI) to initiate the installation process:
    click install for emacs installation
  4. Finally, enter the user password to authenticate and you are done with installation within a few moments.
    authentication via entering user password

How to Uninstall Emacs in Linux?

To uninstall Emacs is to remove the software from the system. This might become necessary whenever a user no longer requires Emacs for text editing-based manipulations. So, this section mentions 3 effective methods to uninstall Emacs in Linux (specifically Ubuntu here).

1. Using “apt” Package Manager

To uninstall the text editor Emacs from the Linux system is to remove it from the system. Using the appropriate package manager is enough to uninstall Emacs—for instance, the apt package manager in Debian-based distros and the yum package manager for Redhat-based distros.

So, to uninstall Emacs from Ubuntu, for example, run the following command in the terminal:

sudo apt remove emacs

removing emacs packageThis removes the Emacs package from the system.

After that, run the following command to remove any associated configuration files for Emacs:

sudo apt autoremove

removing configuration files These steps will successfully uninstall Emacs from the running system.

2. Using “snap” Command

To uninstall Emacs using snap, run the command mentioned below in the terminal:

sudo snap remove emacs

Then verify its removal using the following command:

emacs --version

snap uninstalls emacsSnap uninstalls Emacs which is evident in printing the version of Emacs (error since Emacs is not present).

3. Using GUI

The Graphical User Interface allows for seamless uninstallation of Emacs with a friendly visual interface. The steps to uninstall Emacs from Ubuntu using GUI are given below:

  1. Go to Ubuntu Software and search for Emacs as mentioned in the following image:
    find and select installed emacsYou can click Installed to get Emacs from the list of installed software.
  2. Now, click Emacs (GUI) and finally select Uninstall to remove Emacs (GUI) from the system. Additionally, enter the user password if prompted.
    uninstalling emacs from gui Additionally, do the same for uninstalling Emacs (Terminal).

Conclusion

This article discusses 4 effective methods to display how to install the Emacs text editor in Linux. It has shown both the command line and GUI-specific methods for installing Emacs. Moreover, it sheds light on the uninstallation process of Emacs if necessary using 3 different approaches.

Frequently Asked Questions

How to Install Emacs text editor in Ubuntu?

To install the Emacs text editor in Ubuntu, first open the terminal and then type the command sudo apt update to update the system package index. Finally,  run sudo apt install emacs for Emacs installation to the system (provide user password for sudo access when prompted). Optionally, run the command emacs --version to verify Emacs installation. You can also use the command sudo apt-get install emacs for such installation in Ubuntu.

Can I Uninstall Emacs by using the terminal in Linux?

Yes, you can use the terminal to uninstall Emacs. To uninstall Emacs using the terminal, run the command sudo apt remove emacs if you are using Ubuntu. Then run the command sudo apt autoremove to remove configuration files. So, this will uninstall Emacs from the system.

How to uninstall Emacs using Snap in Linux?

To uninstall Emacs in Linux using snap, open the command line terminal and type the command sudo snap remove emacs. Finally, executing this command will uninstall the Emacs text editor from the system using snap.

Is it possible to install Emacs on Windows OS?

Yes, it is possible to install Emacs in Windows OS. To install Emacs in Windows, first download the installer from the Emacs FTP site (accessible via the official GNU Emacs also). You can download and use the emacs-version-installer.exe file. This will install Emacs for your Windows OS with a shortcut icon for easy access.

How to install Emacs in CentOS?

To install Emacs in CentOS, run the command sudo dnf install emacs -y. This will install the Emacs software in CentOS without prompting to press y for confirmation. In addition, you can use the command sudo yum install emacs to install Emacs (if using an older version of CentOS).

Related Articles


<< Go Back to An Overview of Emacs Text Editor in Linux | Linux Text Editors | Learn Linux Basics

Rate this post
Md Masrur Ul Alam

Assalamu Alaikum, I’m Md Masrur Ul Alam, currently working as a Linux OS Content Developer Executive at SOFTEKO. I completed my Bachelor's degree in Electronics and Communication Engineering (ECE)from Khulna University of Engineering & Technology (KUET). With an inquisitive mind, I have always had a keen eye for Science and Technolgy based research and education. I strongly hope this entity leverages the success of my effort in developing engaging yet seasoned content on Linux and contributing to the wealth of technical knowledge. Read Full Bio

Leave a Comment