How to Install Gedit on Ubuntu 22.04 or 20.04

Gedit, a versatile text editor, is a staple tool for many developers and writers. This guide will demonstrate how to install Gedit on Ubuntu 22.04 or 20.04. Gedit, known for its simplicity and efficiency, offers a range of features that cater to both beginners and advanced users.

Here are some key features that make Gedit a preferred choice:

  • User-friendly Interface: The clean and straightforward layout makes text editing hassle-free.
  • Syntax Highlighting: Supports numerous programming languages, enhancing readability and editing.
  • Customizable Appearance: Themes and fonts can be tailored to individual preferences.
  • Search and Replace: Powerful search functionality, including regular expression support.
  • Plugin Support: Extends functionality, allowing users to tailor the editor to their needs.
  • Multi-document Editing: Enables editing multiple files in tabs, streamlining workflow.

Installing Gedit is the first step to leveraging these features for your text editing needs. The process is straightforward, allowing you to quickly set up and start utilizing Gedit’s robust capabilities. Whether you’re coding, writing documentation, or simply taking notes, Gedit provides the tools to do so efficiently.

Install Gedit on Ubuntu 22.04 or 20.04 via APT

Step 1: Update Ubuntu Before Gedit Installation

To begin, update your Ubuntu system. This is a critical step to ensure that your system’s package list and the installed packages are current. Updating minimizes potential conflicts during the Gedit installation.

Execute the following command in your terminal:

sudo apt update && sudo apt upgrade

This command first updates the list of available packages and their versions then upgrades the installed packages to their latest versions.

Step 2: Install Gedit via APT Command

Once your system is up-to-date, proceed to install Gedit. The recommended method for most Ubuntu users is via the APT package manager, which is designed to be straightforward and efficient. APT facilitates easy installation and management of packages on Debian-based systems like Ubuntu.

To install Gedit, enter the following command in your terminal:

sudo apt install gedit

This command tells APT to fetch the Gedit package from Ubuntu’s official repository and install it on your system. The sudo prefix grants administrative privileges, necessary for installing software. Upon completion, Gedit will be ready to use on your system.

Install Gedit on Ubuntu 22.04 or 20.04 via Flatpak with Flathub

Step 1: Verify Flatpak Installation

Initiate the process by installing the Flatpak package manager. Ubuntu distributions do not come with Flatpak pre-installed, as they primarily use Snap, developed by Canonical, the company behind Ubuntu. However, Flatpak can be easily installed from Ubuntu’s default repositories. This step is crucial for users who do not have Flatpak installed.

To install Flatpak, execute the following command:

sudo apt install flatpak -y

This command installs Flatpak on your Ubuntu system. The -y flag automatically answers ‘yes’ to all prompts during installation, streamlining the process.

Step 2: Enable Flathub for Gedit Installation

Once Flatpak is installed, the next step is to enable Flathub, a major repository for Flatpak applications. Flathub hosts a vast array of applications, including Gedit, and is essential for accessing them. Run the following command to add Flathub as a remote source in Flatpak:

sudo flatpak remote-add --if-not-exists flathub

This command ensures that Flathub is added only if it does not already exist as a remote source, preventing duplication.

Step 3: Install Gedit via Flatpak Command

With Flathub enabled, you can now install Gedit using Flatpak. This method is beneficial for users seeking the latest version of Gedit, as Flatpak often provides more up-to-date software than the default Ubuntu repositories. Use this command to install Gedit:

flatpak install flathub org.gnome.gedit

This command fetches and installs Gedit from Flathub, ensuring you have the latest stable version. For users looking for more comprehensive instructions on installing or upgrading Flatpak, visit our guide.

Install Gedit on Ubuntu 22.04 or 20.04 via Snapcraft

Step 1: Verify Snap is Installed

Begin by ensuring Snap, Ubuntu’s default package manager, is installed on your system. Snapcraft, often referred to simply as Snap, is typically pre-installed on Ubuntu systems. However, if you have previously removed it, it’s necessary to reinstall it. Snap offers a streamlined approach to software management, providing up-to-date packages and a wide range of applications.

To reinstall Snap, use the following command:

sudo snap install snapd -y

This command reinstalls the Snap daemon, snapd, which is essential for managing Snap packages. The -y flag automates the confirmation process for a smoother installation.

Following the reinstallation of Snap, install the snap core package. This step is vital for ensuring the smooth operation of Snap applications and avoiding potential conflicts. Execute this command:

sudo snap install core

After setting up the core package, some Snap applications require ‘classic’ confinement for additional permissions. To enable this, create a symbolic link using the following command:

sudo ln -s /var/lib/snapd/snap /snap

This command creates a symbolic link between the Snap directory and the system, enabling classic snap support.

Step 2: Install Gedit via Snap Command

With Snap properly configured, you can now install Gedit. Snap offers the advantage of providing the most recent versions of software, often updated within days of release. To install Gedit via Snap, enter:

sudo snap install gedit

This command tells Snap to download and install the Gedit package. Upon completion, you will have access to the latest version of Gedit on your Ubuntu system with the Snapcraft package manager.

Launch Gedit on Ubuntu 22.04 or 20.04

Now that you have the text editor installed launching can be done in three ways.

CLI Commands to Launch Gedit

If you installed Gedit using APT or Snap, use this simple command in your terminal:


For those who installed Gedit via Flatpak, the launch command differs slightly:

flatpak run org.gnome.gedit

If you installed Gedit using Snap, use the following command:

snap run gedit

GUI Method to Launch Gedit

Alternatively, you can launch Gedit using Ubuntu’s graphical user interface (GUI), a more user-friendly approach that doesn’t require command-line knowledge.

  1. Accessing Gedit via GUI: Navigate through the following steps on your Ubuntu desktop:
    • Click on “Activities” at the top left corner of your screen.
    • Choose “Show Applications” from the bottom left of the dock.
    • Find and click on the “Text Editor (gedit)” icon.
Gedit application icon in Ubuntu's Show Applications menu
Gedit Icon in Ubuntu’s Application Menu

First-Time Tips with Gedit on Ubuntu 22.04 or 20.04

Now that you have successfully installed Gedit on Ubuntu, here are some first-time tips on getting started with the software:

General Tips for New Gedit Users on Ubuntu

  • Familiarize with the Interface: Explore the simple and intuitive interface of Gedit. This includes the menu bar, toolbar, text area, and status bar.
  • Keyboard Shortcuts: Leverage keyboard shortcuts for efficiency. For instance, Ctrl+S for saving and Ctrl+Z for undoing changes.
  • Working with Multiple Documents: Utilize the tab feature to work on multiple documents simultaneously, enhancing productivity.

Gedit Customizations to Enhance Your Experience on Ubuntu

  • Changing Themes and Fonts:
    • Access Preferences from the Edit menu.
    • Under the Fonts & Colors tab, explore various themes and font options to customize your visual experience.
  • Configuring Plugins:
    • Navigate to Preferences and select the Plugins tab.
    • Enable useful plugins like File Browser Pane or Spell Checker to tailor Gedit to your needs.
  • Adjusting Preferences:
    • In the Preferences window, tweak settings like Auto-indentation, Text wrapping, and Line numbering under the Editor tab for a personalized editing environment.

Other Gedit Useful Tips on Ubuntu

  • Regular Expressions in Search: Use regular expressions for advanced search capabilities. Access this via Ctrl+F and select the regular expression icon.
  • External Tool Integration: Integrate external tools for tasks like compiling code. This is done through the External Tools plugin in the Plugins tab.
  • Syntax Highlighting: Gedit automatically highlights syntax for various programming languages. This feature is invaluable for coding and script editing.
Gedit text editor open on Ubuntu desktop
Gedit Open and Ready on Ubuntu

Managing Gedit on Ubuntu 22.04 or 20.04

Update Gedit on Ubuntu

To ensure Gedit remains current with the latest features and security updates, regularly updating it is essential. The update process varies based on your installation method.

APT Update Method for Gedit

For Gedit installations via APT, use the following command to update:

sudo apt upgrade && sudo apt upgrade

This command first refreshes your package list (sudo apt update) and then upgrades all your installed packages, including Gedit, to their latest versions (sudo apt upgrade).

Flatpak Update Method for Gedit

If you installed Gedit using Flatpak, the update command is:

flatpak update

This command checks for updates for all installed Flatpak applications, including Gedit, and applies them.

Snap Update Method for Gedit

For Snap installations, use this command to update Gedit:

sudo snap update

This refresh command updates Gedit installed via Snap to its latest version.

Remove (Uninstall) Gedit From Ubuntu

If Gedit is no longer needed, you can uninstall it. The uninstallation command depends on how Gedit was originally installed.

APT Remove Method for Gedit

To uninstall Gedit installed via APT, execute:

sudo apt autoremove gedit -y

The autoremove command not only removes Gedit but also any unused dependencies. The -y flag confirms the removal automatically.

Flatpak Remove Method for Gedit

For removing Gedit installed via Flatpak, use:

flatpak uninstall --delete-data flathub org.gnome.gedit -y

This command uninstalls Gedit and removes its associated data. The -y option ensures the process proceeds without manual confirmations.

Snap Remove Method for Gedit

To remove Gedit installed with Snap, the command is:

sudo snap remove gedit

This command straightforwardly removes the Gedit package installed through Snap.


In this guide, we’ve explored the various methods to install, update, and manage Gedit on Ubuntu 22.04 or 20.04, ensuring you have the knowledge to efficiently utilize this versatile text editor. Whether you prefer APT, Flatpak, or Snap, each method provides a straightforward path to getting Gedit up and running on your system. Remember, regular updates are key to maintaining the software’s performance and security. As you embark on your journey with Gedit, don’t hesitate to explore its customization options and plugins to enhance your editing experience. Happy editing!

Leave a Comment

Your Mastodon Instance
Share to...