How to Install GitHub Desktop on Ubuntu 24.04, 22.04 or 20.04

GitHub Desktop is a user-friendly graphical interface that simplifies the management of Git repositories, making it easier for developers to manage their code and collaborate with others. It provides features like seamless repository management, branch creation, pull requests, and simplified merging, all without needing to use the command line. Installing GitHub Desktop on Ubuntu 24.04, 22.04, or 20.04 can be done through several methods, each offering different levels of convenience and flexibility.

To install GitHub Desktop, you have three primary methods: using the .deb package, setting up the APT mirror from the Shiftkey GitHub Desktop GitHub project for easy updates and maintenance, or installing via Flatpak with Flathub. This guide will walk you through each of these methods, ensuring you can choose the one that best fits your needs.

Update Ubuntu Before GitHub Desktop Installation

Before starting the installation process, it’s essential to ensure your system is up-to-date to prevent conflicts. You can do this by using the following command in the terminal:

sudo apt update && sudo apt upgrade

This command updates your system’s package lists and installs any available updates, ensuring you have the latest software installed.

Select Installation Method for GitHub Desktop

Option 1: Install GitHub Desktop on Ubuntu via .deb package

GitHub supports only Windows and macOS by default. However, Linux users can access GitHub through the “shiftkey/desktop” project. This fork provides downloadable packages for various Linux distributions.

Navigate to the releases page and download the latest release. Although the guide suggests installing the “.deb” package, you may opt for the appimage if you prefer it and know how to use it.

Use the following command in your terminal to download the latest release:

wget https://github.com/shiftkey/desktop/releases/download/release-3.1.7-linux1/GitHubDesktop-linux-3.1.7-linux1.deb

Note: Remember to get the latest link. The above command is just an example using the wget command.

This command downloads and installs version 3.1.7 RC1 as an example. Replace <filename> in the command below with the name of the “.deb” file you’ve downloaded:

sudo dpkg -i <filename>.deb

Example with 3.1.7 RC1:

sudo dpkg -i GitHubDesktop-linux-3.1.7-linux1.deb

Ubuntu users unfamiliar with dpkg should note that it is a package manager for installing, removing, and managing Debian packages. This low-level tool installs .deb packages on your Ubuntu system. The “-i” flag instructs dpkg to install the specified package; when using it, provide the package filename you wish to install as an argument.

Option 2: Install GitHub Desktop via APT PPA

The second GitHub Desktop installation option mirrors the first. Two APT third-party repositories in the United States mirror the shiftkey/desktop GitHub project. The project’s page lists and recommends these repositories. This method simplifies updating your GitHub Desktop application and other packages. However, some global users might experience connection issues to a US mirror, which won’t impact most users.

Note: Only one mirror; you can safely import the other if it does not work.

Import Shiftkey GitHub Desktop Mirror

The first one is recommended, but you can use the second one if you encounter any issues.

Import GPG key and repository for @shiftkey:

GPG Key:

wget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null

Repository:

sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main" > /etc/apt/sources.list.d/shiftkey-packages.list'

Import Mwt GitHub Desktop Mirror

Alternative mirror by @mwt:

GPG Key:

wget -qO - https://mirror.mwt.me/shiftkey-desktop/gpgkey | gpg --dearmor | sudo tee /etc/apt/keyrings/mwt-desktop.gpg > /dev/null
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/mwt-desktop.gpg] https://mirror.mwt.me/shiftkey-desktop/deb/ any main" > /etc/apt/sources.list.d/mwt-desktop.list'

After importing a mirror, run a quick APT update to reflect the newly added lists.

sudo apt update

To install GitHub Desktop, use the following command:

sudo apt install github-desktop

Option 3: Install GitHub Desktop via Flatpak and Flathub

The third method to install GitHub Desktop on Ubuntu involves using Flatpak, a powerful utility that simplifies installing and managing Linux applications. Flatpak provides a secure and isolated environment where applications can run on your system, offering benefits such as better stability, improved security, and easier dependency management.

Note: If you’re unfamiliar with installing Flatpak, we recommend following our step-by-step guide for Ubuntu. This guide uses the official LaunchPAD PPA provided by the Flatpak team to help you through the process.

Enable Flathub Repository for GitHub Desktop

To use Flatpak, you must enable it on your Ubuntu system by executing a command in your terminal. The command you need to run is as follows:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Install GitHub Desktop via Flatpak Command

Now install Github using the following flatpak command:

flatpak install -y flathub io.github.shiftey.Desktop

This command downloads and installs the GitHub Desktop application, including all necessary dependencies, onto your Ubuntu system.

Launch GitHub Desktop via CLI Commands or GUI Path

CLI Commands to Launch GitHub Desktop UI

First, if you have your terminal open, you can launch the GitHub desktop client using the following command:

github-desktop

Flatpak users, you can use the following command to launch immediately:

flatpak run io.github.shiftey.Desktop

GUI Path to Launch GitHub Desktop UI

Alternatively, you can find GitHub Desktop on your desktop by clicking “Activities” and selecting “Show Applications.” This lists all installed applications on your system, including GitHub Desktop. You can click on the application to launch it and start using it for your projects.

Additional GitHub Desktop Commands

Update GitHub Desktop

The process for updating your GitHub Desktop installation on Ubuntu differs slightly depending on whether you installed it via Flatpak, a .deb package, or APT.

For Flatpak installations, you can run the following command in the terminal to check for updates:

flatpak update

If you installed GitHub Desktop using the APT mirror, you could run the standard APT update and upgrade commands:

sudo apt update && sudo apt upgrade

However, if you installed GitHub Desktop using the .deb package, you must update it manually. To do this, you can visit the official GitHub Desktop releases page, download the latest .deb package, and install it using the dpkg command.

Remove GitHub Desktop

To remove GitHub Desktop from your Ubuntu system, if it no longer interests you, use a simple terminal command that matches the package manager from which you originally installed the software.

APT GitHub Desktop Remove Method

If you installed GitHub Desktop using the APT package manager, you could use the following command to remove the desktop client:

sudo apt remove github-desktop

Remove the APT repository if you don’t plan to reinstall GitHub using this method. Execute the appropriate command corresponding to the imported repository.

sudo rm /etc/apt/sources.list.d/shiftkey-packages.list
sudo rm /etc/apt/sources.list.d/mwt-desktop.list

Flatpak GitHub Desktop Remove Method

For installations using Flatpak, you can use the following command to remove GitHub Desktop, including all its data:

flatpak remove  -y --delete-data io.github.shiftey.Desktop

This command deletes all associated data and configuration files from your system, frees up space, and ensures a clean uninstallation.

.deb GitHub Desktop Remove Method

However, if you installed GitHub Desktop using the .deb package, you’ll need to use the dpkg command to remove it manually. You can use the following command to remove the package:

sudo dpkg -r github-desktop

or

sudo apt remove github-desktop

This command removes the package from your system but doesn’t delete any associated data or configuration files. To remove these, use the –purge option.

Conclusion and Wrap-up

By installing GitHub Desktop on your Ubuntu system using your preferred method, you can streamline your Git workflow with a powerful graphical interface. Whether you choose the simplicity of the .deb package, the convenience of the APT mirror for easy updates, or the flexibility of Flatpak with Flathub, each method provides a reliable way to enhance your development experience. Regular updates, especially when using the APT mirror or Flatpak, will keep your GitHub Desktop installation up to date with the latest features and improvements, ensuring a smooth and efficient coding environment on Ubuntu.

Leave a Comment