FUNDAMENTALS A Complete Guide for Beginners
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:
- Run the following command first to update the system repository list:
sudo apt update
- Now, run the command mentioned below to install the Emacs text editor:
sudo apt install emacs
Note: You can also use the commandsudo apt install emacs -y
for installation. This directly completes installation without prompting for pressing “y” later. - Finally, to verify the installation, use the following command:
emacs --version
The 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
Snap 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:
- 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
- After updating the system repository list using sudo apt update, execute the command below to install the latest version:
sudo apt install emacs
- Finally, run the
emacs --version
command to verify the installation of the latest version:
The 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:
- First, go to the application menu and Access Ubuntu Software:
- Then search for Emacs and select.
- Now, click theInstall button for Emacs (GUI) to initiate the installation process:
- Finally, enter the user password to authenticate and you are done with installation within a few moments.
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
This removes the Emacs package from the system.
After that, run the following command to remove any associated configuration files for Emacs:
sudo apt autoremove
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 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:
- Go to Ubuntu Software and search for Emacs as mentioned in the following image:
You can click Installed to get Emacs from the list of installed software. - Now, click Emacs (GUI) and finally select Uninstall to remove Emacs (GUI) from the system. Additionally, enter the user password if prompted.
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
- How to Cut, Copy, and Paste in Emacs [2 Methods]
- How to Exit Emacs Text Editor in Linux? [4 Methods]
<< Go Back to An Overview of Emacs Text Editor in Linux | Linux Text Editors | Learn Linux Basics