Emacs editor is a text editor that comes with amazing features like customization and extensions. With these features, Emacs can be used for coding purposes with support for programming languages like java, c++, and python.
In this article, you will explore all the ways you can install this amazing piece of software in your Linux mint system.
Note: You will need a root or sudo privileged account to perform the installation and uninstallation of emacs editor through following methods.
Using the APT Package
You can use the APT package that comes with the system to install the Emacs editor.
First, run the following command to ensure your system repositories are up to date.
sudo apt-get update
Next, install Emacs through the following command.
sudo apt-get install emacs
You can open the emacs from Utilities in your system or simply typing “emacs” in the terminal.
You can also check the version of your installed emacs through the following command.
To remove the emacs editor and its configuration file that is installed through an APT package, run the following command.
sudo apt-get purge emacs
Next, Remove all the remaining dependent packages through the following command.
sudo apt-get autoremove
Using the PPA Repository
Sometimes, packages that come with the system are not the latest version available. If you want the latest version of the software, you need to install it directly from the Personal Package Archives (PPA) of the software.
To install Emac editor in your system, you need to add the Emacs PPA repository in your system.
sudo add-apt-repository ppa:kelleyk/emacs
Next, update your system with the following command
sudo apt-get update
Now, you can install the emacs editor with the following command.
sudo apt install emacs
In case there is more than one Emacs package in your system, you can specify the version during installation.
sudo apt install emacs27
Installed software via a PPA cannot be uninstalled by usual means. You need the ppa-purge package to remove the PPA-installed software. Install the ppa-purge package by running the following command.
sudo apt-get install ppa-purge
Now you can use the ppa-purge command to uninstall software that is installed by the Emacs repository.
sudo ppa-purge ppa:kelleyk/emacs
Using the Snap Package
If you prefer a stand-alone independent application, you should use the Emacs snap package to install the Emacs editor.
First, You need to install snapd to run the snap packages.
In Linux Mint 20, you need to delete a certain file that prevents the snap package by default. To do that, run the following command.
sudo rm /etc/apt/preferences.d/nosnap.pref
Next, update the system and install snapd package
sudo apt update
sudo apt install snapd
Now, you can easily run your Emacs snap to install Emacs editor.
sudo snap install emacs --classic
To remove the Emacs installed through snap package, run the following command.
sudo snap remove emacs
Using the Flatpak Package
You can install the Emacs flatpak from flathub to install the Emacs editor.
Add the Flatpak through the following command.
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Now run the following command to run the install Emacs editor.
sudo flatpak install flathub org.gnu.emacs
You can remove the Emacs editor installed via flatpak by running the following command in the terminal.
sudo flatpak uninstall org.gnu.emacs
In this article, you have learned how you can install and uninstall the Emacs editor via different means.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.