How to install Emacs in Ubuntu 22.04 and 20.04

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to install Emacs in Ubuntu 22.04 and Ubuntu 20.04.

Emacs is a free and open source text editor for Linux.

Emacs supports many programming languages, which means you can use Emacs to write code in your favorite language.

In Ubuntu 22.04 and Ubuntu 20.04, Emacs can be found on the default repositories of Ubuntu, so you can easily install Emacs via the terminal.

In this tutorial, we'll be installing the official package of Emacs emacs via the apt.

Install Emacs on Ubuntu 22.04 and Ubuntu 20.04

Step 1 - Update the system

Emacs can be found in the default repositories for Ubuntu 22.04 and Ubuntu 20.04, which is enabled by default in your system. To make sure that you can install emacs without issues, proceed to update your system.

sudo apt update

Step 2 - Install Emacs

Installing Emacs in Ubuntu 22.04 and Ubuntu 20.04, can be easily done via the terminal by installing the official package emacs which is found in the Universe repository for both of these versions.

sudo apt install emacs

Step 3 - Verify Emacs Installation

Emacs should be now installed on your system.

However, before you launch Emacs, you need to check if Emacs was installed with no issues.

To do so, check Emacs version with.

emacs --version

Step 4 - Launch Emacs

There are two ways you can use to launch Emacs in your machine.

If you are a terminal fan, and want to launch Emacs via terminal, then run the command below.

emacs

If you like using GUI instead to launch Emacs, then simply go to Activities Overview, and search for "Emacs"

And launch Emacs gui by clicking it.

Uninstall Emacs in Ubuntu 22.04 and Ubuntu 20.04

If you no longer need Emacs in your system, whether your system is Ubuntu 22.04 or Ubuntu 20.04, you can easily uninstall Emacs from the terminal.

To do so, simply run the command below.

sudo apt remove emacs

Conclusion

In this tutorial, you learned how to install and uninstall Emacs in Ubuntu 22.04 and Ubuntu 20.04.

Although this is not the only way to install Emacs, it's definitely one of the fastest and safest way of doing so.

By now you should be able to use Emacs in your system.