AlmaLinuxRHEL Based

How To Install Emacs on AlmaLinux 9

Install Emacs on AlmaLinux 9

In this tutorial, we will show you how to install Emacs on AlmaLinux 9. Emacs, the legendary text editor, has been a staple in the Linux community for decades. Its powerful features, extensibility, and versatility make it a favorite among developers, writers, and power users alike.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of GNU Emacs on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux or RHEL-based.


  • A server running one of the following operating systems: AlmaLinux 9.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Emacs.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Emacs on AlmaLinux 9

Step 1. Keeping your system up-to-date is crucial for ensuring optimal performance, security, and compatibility. Before installing Emacs, it’s a good practice to clean and update the package cache:

sudo dnf clean all
sudo dnf update

This command will remove any cached package data and update your system with the latest available packages and security patches.

After updating your system, it’s a good practice to verify that the process was completed successfully. You can do this by running:

sudo dnf list updates

Step 2. Installing Emacs on AlmaLinux 9.

Emacs is renowned for its extensibility and powerful features. To install it on your AlmaLinux 9 system, follow these steps:

sudo dnf install emacs

AlmaLinux will prompt you to confirm the installation by entering ‘y.’ Press ‘y‘ and then ‘Enter‘ to proceed.

Once the installation is complete, you can verify the Emacs version to ensure it was installed correctly:

emacs --version

To start Emacs for the first time, simply type:


Install Emacs on AlmaLinux 9

Step 3. Basic Emacs Usage.

Now that you have Emacs installed, let’s explore some basic usage to get you started:

Opening and Creating Files

  • To open an existing file, press Ctrl-x Ctrl-f and type the file’s path.
  • To create a new file, press Ctrl-x Ctrl-f and specify a new file name.

Basic Navigation

  • Use the arrow keys or Ctrl-n (next line), Ctrl-p (previous line), Ctrl-f (forward), and Ctrl-b (backward) to navigate through your text.

Editing and Saving Files

  • To start typing, simply begin typing on your keyboard.
  • To save your changes, press Ctrl-x Ctrl-s.
  • To undo changes, press Ctrl-x u.

Exiting Emacs

To exit Emacs:

  1. Press Ctrl-x Ctrl-c.
  2. Emacs will ask if you want to save any unsaved changes. Press ‘y’ or ‘n’ accordingly.

Step 4. Troubleshooting.

While installing and using Emacs on AlmaLinux 9 is generally straightforward, you may encounter some issues along the way. Here are some common problems and their solutions:

Issue: Emacs Won’t Start

  • Solution: Ensure you installed Emacs correctly using sudo dnf install emacs. Check for any error messages during installation.

Issue: Missing Packages

  • Solution: If you encounter “Package not found” errors when installing packages, update your package repository and try again.

Issue: Conflicting Keybindings

  • Solution: If you experience conflicts with system shortcuts, consider reassigning Emacs keybindings in your init.el file.

Congratulations! You have successfully installed Emacs. Thanks for using this tutorial for installing GNU Emacs on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Emacs website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!


r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button