Categories: Ubuntu

How To Install Emacs Text Editor on Ubuntu 22.04

Emacs is an amazing text editor available on all major operating systems from BSD to Linux to macOS and Windows. One of the biggest reasons people love Emacs is that it comes loaded with a wide range of commands designed for the simplest and the most complex tasks. It has almost 40 years of plugin development and configuration hacks working for it.

In this guide, we will install the emacs-gtk package, which is a GUI package of Emacs based on the GTK+ package rather than Lucid.

Update the apt Database

Updating this database before any installation is always a good idea. It helps resolve any system-level dependencies for the new application. In your terminal, type the following to start the update:

$sudo apt update

After the update is complete, we can use the traditional method to install the Emacs text editor.

Installing Emacs-gtk

To install Emacs, type the following to start the installation process for emacs-gtk:

$sudo apt -y install emacs-gtk

Depending on the speed of your Internet connection, the process will approximately take a minute to complete the installation. Once the prompt returns without errors, you should know that the installation has been successfully completed.

Running Emacs

Once the installation has been completed, simply type “emacs” in your terminal, and it will launch the text editor:

$emacs

You need to be sure that the text editor is tied to the terminal which launched it. If you close the terminal, the Emacs will close along with it. Or, if you prefer the GUI way, you can always go into applications to launch it.

Learning Emacs

If by now you are feeling overwhelmed, you shouldn’t worry. There is an extensive community and detailed tutorials within the editor itself. You can click on any of the following to get started:

Uninstalling Emacs

When you’re done with the project, or you simply want to uninstall with the text editor, you can uninstall it with the following:

$sudo apt remove emacs-gtk

Uninstalling Along With Dependencies

To uninstall emacs-gtk along with all of its dependencies, we can use the following:

$sudo apt-get -y autoremove emacs-gtk

Remove the Configs Along With the Data

If you don’t want simply to uninstall, and you want to get rid of all the configuration files along with all the data, you can use the following to uninstall along with the removal of configs and data:

$sudo apt-get purge emacs-gtk

Leaving No Trail Behind

If you have limited resources and want to get rid of every single thing related to Emacs from your Ubuntu 22.04, use the following:

$sudo apt-get -y autoremove –purge emacs-gtk

Conclusion

Emacs is older than many of the modern computing conventions in some of the other packages. Due to this, you will see outdated terminology like “visiting” a file instead of opening it and “writing” instead of saving a file. Thus, Emacs is often viewed as intricate and even enigmatic. But, once you learn the basics, you’ll understand the whole power behind the platform. If this has piqued your interest, you can head to LinuxHint or their website to learn more.

Ubuntu Server Admin

Recent Posts

A year of documentation-driven development

For many software teams, documentation is written after features are built and design decisions have…

9 hours ago

Announcing FIPS 140-3 for Ubuntu Core22

With the release of the FIPS 140-3 certified cryptographic modules for Ubuntu 22.04 LTS, Canonical…

1 day ago

The foundations of software: open source libraries and their maintainers

Open source libraries are repositories of code that developers can use and, depending on the…

4 days ago

From inspiration to impact: design students from Regent’s University London explore open design for their dissertation projects

Last year, we had the opportunity to speak at Regent’s UX Conference (Regent’s University London’s…

5 days ago

When an upstream change broke smartcard FIPS authentication – and how we fixed it

A government agency mandated smartcard authentication across their Ubuntu fleet. When they enabled FIPS mode…

6 days ago

Open platforms, edge AI, and sovereign telco clouds: Ecrio & Canonical at MWC Barcelona

Building telco clouds with open source At MWC Barcelona 2026, Canonical is demonstrating how telecommunications…

6 days ago