Geany is a lightweight and fast text editor with IDE (Integrated Development Environment) features, designed for programmers and developers. It supports numerous programming languages, including C, C++, Python, Java, and HTML, making it a versatile tool for coding. Geany is known for its simplicity, providing features like syntax highlighting, code folding, and an integrated terminal while maintaining a small footprint and fast performance.
On Ubuntu 24.04, 22.04, or 20.04, Geany can be installed using two primary methods. The first method is via the Ubuntu default repository, which offers a straightforward and stable installation. Alternatively, Geany can be installed via Flatpak with Flathub, which might provide newer versions and a more isolated environment. This guide will walk you through both installation methods, allowing you to choose the best option for your setup.
Method 1: Install Geany on Ubuntu with APT
Update Ubuntu Before Geany Installation
To ensure your Ubuntu system is up-to-date and has the latest packages, run the following command:
sudo apt update && sudo apt upgrade
This command synchronizes your package index with the remote repositories and upgrades any outdated packages.
Install Geany via APT Command
The first method to install Geany is by using the default Ubuntu repository. This approach is recommended for users who want to maintain their system solely with APT packages and avoid third-party package managers.
To install Geany, execute the following command:
sudo apt install geany
For those seeking a much-updated version of Geany, see the next section for the alternative method of installing Geany with Flatpak.
Method 2: Install Geany with Flatpak and Flathub
This section will explore an alternative method for installing Geany using the Flatpak package manager. Flatpak is a popular option similar to Snap and is featured across many Linux distributions as a third-party installation package manager for obtaining the latest packages.
Note: If your system does not have Flatpak installed, please refer to our guide on “How to Install Flatpak on Ubuntu” for step-by-step instructions on installing the most recent supported version of Flatpak.
Enable Flathub for Geany
Before installing Geany through Flatpak, you must enable the Flathub repository, a primary source for Flatpak applications. To enable Flathub, execute the following command in your terminal:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
This command adds the Flathub repository to your Flatpak configuration, ensuring you have access to a wide variety of applications, including Geany.
Install Geany via Flatpak Command
With Flathub enabled, you can now proceed to install Geany using the flatpak install command. Run the following command in your terminal:
flatpak install flathub org.geany.Geany -y
This command installs the Geany IDE from the Flathub repository, providing you with the latest version of the application.
Launching Geany via CLI or GUI
Once you have successfully installed Geany on your system, there are multiple ways to launch the application.
Launch Geany using the Terminal
You can launch Geany with a simple command for users who prefer using the terminal. If you have installed Geany using APT, execute the following command:
geany
For those who have installed Geany using Flatpak, use the following command instead:
flatpak run org.geany.Geany
Launch Geany from the Desktop
For a more user-friendly approach, particularly for desktop users, you can quickly launch Geany through the graphical interface. To do this, follow the path below:
Activities > Show Applications > Geany
Additional Geany Commands
Update Geany
To keep Geany and its associated system packages up-to-date, you can use the following commands depending on your installation method.
APT Update Method for Geany
sudo apt upgrade && sudo apt upgrade
This command updates the package lists and upgrades any outdated packages, including Geany, when installed using the APT package manager.
Flatpak Update Method for Geany
flatpak update
This command updates all installed Flatpak applications, including Geany, to their latest versions.
Remove Geany
If you no longer require Geany, you can use one of the following commands to remove the software based on your original installation method.
APT Remove Method for Geany
sudo apt remove geany
When installed using the APT package manager, this command removes Geany from your system.
Flatpak Remove Method for Geany
flatpak uninstall --delete-data org.geany.Geany -y
This command uninstalls Geany and removes its associated data when installed using Flatpak.
Conclusion
By installing Geany on your Ubuntu system using either the Ubuntu default repository or Flatpak with Flathub, you gain access to a powerful yet lightweight text editor suited for various programming tasks. The default repository method provides ease and stability, while Flatpak offers the potential for newer versions and a sandboxed environment. Regular updates through these channels will keep Geany current, enabling you to work efficiently with a reliable and feature-rich editor on Ubuntu.