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:

Sponsored
$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

Sponsored

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

Cut data center energy costs with bare metal automation

Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…

20 hours ago

Build the future of *craft: announcing Starcraft Bounties!

Our commitment to building a thriving open source community is stronger than ever. We believe…

20 hours ago

NodeJS 18 LTS EOL extended from April 2025 to May 2032 on Ubuntu

The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…

20 hours ago

Native integration now available for Pure Storage and Canonical LXD

June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…

2 days ago

Revolutionizing Web Page Creation: How Structured Content is Slashing Design and Development Time

Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…

3 days ago

Ubuntu Weekly Newsletter Issue 897

Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…

4 days ago